From c24f5fb256f53836727d3479e0fcf79d680ca2ca Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 2 May 2025 14:00:10 +0200 Subject: test: Finish migrating tests/Core/ to PHPUnit 10 compatible code Signed-off-by: Joas Schilling --- tests/lib/Files/Storage/Wrapper/AvailabilityTest.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/lib/Files/Storage/Wrapper') diff --git a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php index 616fd023414..29277772358 100644 --- a/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php +++ b/tests/lib/Files/Storage/Wrapper/AvailabilityTest.php @@ -76,12 +76,16 @@ class AvailabilityTest extends \Test\TestCase { $this->storage->expects($this->once()) ->method('test') ->willReturn(true); + $calls = [ + false, // prevents concurrent rechecks + true, // sets correct availability + ]; $this->storage->expects($this->exactly(2)) ->method('setAvailability') - ->withConsecutive( - [$this->equalTo(false)], // prevents concurrent rechecks - [$this->equalTo(true)] // sets correct availability - ); + ->willReturnCallback(function ($value) use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, $value); + }); $this->storage->expects($this->once()) ->method('mkdir'); -- cgit v1.2.3