diff options
author | Joas Schilling <coding@schilljs.com> | 2024-09-19 18:19:32 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-09-19 18:19:32 +0200 |
commit | 4ccf62a2249495b5f01582fa529762e631051c56 (patch) | |
tree | 90191101e56ff673125988068e091b1c7e207ae4 /apps/workflowengine | |
parent | 96de697aa6fe7e75c7e311e07536cc84a29a0088 (diff) | |
download | nextcloud-server-4ccf62a2249495b5f01582fa529762e631051c56.tar.gz nextcloud-server-4ccf62a2249495b5f01582fa529762e631051c56.zip |
chore: Cleanup and prepare some app tests for PHPUnit 10ci/noid/prepare-phpunit-10
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r-- | apps/workflowengine/tests/Check/AbstractStringCheckTest.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/tests/ManagerTest.php | 20 |
2 files changed, 14 insertions, 9 deletions
diff --git a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php index eb40b164176..c598c756bed 100644 --- a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php +++ b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php @@ -22,8 +22,7 @@ class AbstractStringCheckTest extends \Test\TestCase { ->setConstructorArgs([ $l, ]) - ->setMethods([ - 'setPath', + ->onlyMethods([ 'executeCheck', 'getActualValue', ]) diff --git a/apps/workflowengine/tests/ManagerTest.php b/apps/workflowengine/tests/ManagerTest.php index 334666af039..2d078c75490 100644 --- a/apps/workflowengine/tests/ManagerTest.php +++ b/apps/workflowengine/tests/ManagerTest.php @@ -362,16 +362,22 @@ class ManagerTest extends TestCase { $cache->expects($this->exactly(4)) ->method('remove') ->with('events'); - $this->cacheFactory->method('createDistributed')->willReturn($cache); + $this->cacheFactory->method('createDistributed') + ->willReturn($cache); + $expectedCalls = [ + [IManager::SCOPE_ADMIN], + [IManager::SCOPE_USER], + ]; + $i = 0; $operationMock = $this->createMock(IOperation::class); $operationMock->expects($this->any()) ->method('isAvailableForScope') - ->withConsecutive( - [IManager::SCOPE_ADMIN], - [IManager::SCOPE_USER] - ) - ->willReturn(true); + ->willReturnCallback(function () use (&$expectedCalls, &$i): bool { + $this->assertEquals($expectedCalls[$i], func_get_args()); + $i++; + return true; + }); $this->container->expects($this->any()) ->method('query') @@ -390,7 +396,7 @@ class ManagerTest extends TestCase { $this->createMock(UserMountCache::class), $this->createMock(IMountManager::class), ]) - ->setMethodsExcept(['getEvents']) + ->onlyMethods($this->filterClassMethods(File::class, ['getEvents'])) ->getMock(); } return $this->createMock(ICheck::class); |