diff --git a/.gitignore b/.gitignore index afd585a4..6b22f8f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ /tmp /tools /vendor -.phpunit.result.cache +.phpunit.cache # OS generated files # ###################### diff --git a/composer.json b/composer.json index 68741f97..b1ffa241 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "cakephp/cakephp": "5.x-dev", "cakephp/cakephp-codesniffer": "^5.0", "cakephp/plugin-installer": "^1.3", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.1.0" }, "suggest": { "cakephp/http": "To use \"RequestPolicyInterface\" (Not needed separately if using full CakePHP framework).", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bb7a5802..ac8df8bd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,11 @@ - + @@ -15,14 +16,14 @@ - + - + src/ - + diff --git a/tests/TestCase/AuthorizationServiceTest.php b/tests/TestCase/AuthorizationServiceTest.php index a8c5d57f..457c75f2 100644 --- a/tests/TestCase/AuthorizationServiceTest.php +++ b/tests/TestCase/AuthorizationServiceTest.php @@ -301,7 +301,8 @@ public function testBeforeFalse() $entity = new Article(); $policy = $this->getMockBuilder(BeforePolicyInterface::class) - ->setMethods(['before', 'canAdd']) + ->onlyMethods(['before']) + ->addMethods(['canAdd']) ->getMock(); $policy->expects($this->once()) @@ -331,7 +332,8 @@ public function testBeforeTrue() $entity = new Article(); $policy = $this->getMockBuilder(BeforePolicyInterface::class) - ->setMethods(['before', 'canAdd']) + ->onlyMethods(['before']) + ->addMethods(['canAdd']) ->getMock(); $policy->expects($this->once()) @@ -361,7 +363,8 @@ public function testBeforeNull() $entity = new Article(); $policy = $this->getMockBuilder(BeforePolicyInterface::class) - ->setMethods(['before', 'canAdd']) + ->onlyMethods(['before']) + ->addMethods(['canAdd']) ->getMock(); $policy->expects($this->once()) @@ -393,7 +396,8 @@ public function testBeforeResultTrue() $entity = new Article(); $policy = $this->getMockBuilder(BeforePolicyInterface::class) - ->setMethods(['before', 'canAdd']) + ->onlyMethods(['before']) + ->addMethods(['canAdd']) ->getMock(); $policy->expects($this->once()) @@ -423,7 +427,8 @@ public function testBeforeResultFalse() $entity = new Article(); $policy = $this->getMockBuilder(BeforePolicyInterface::class) - ->setMethods(['before', 'canAdd']) + ->onlyMethods(['before']) + ->addMethods(['canAdd']) ->getMock(); $policy->expects($this->once()) diff --git a/tests/TestCase/IdentityDecoratorTest.php b/tests/TestCase/IdentityDecoratorTest.php index 69549d7a..d452f456 100644 --- a/tests/TestCase/IdentityDecoratorTest.php +++ b/tests/TestCase/IdentityDecoratorTest.php @@ -16,7 +16,7 @@ */ class IdentityDecoratorTest extends TestCase { - public function constructorDataProvider() + public static function constructorDataProvider() { return [ 'array' => [ diff --git a/tests/TestCase/Middleware/UnauthorizedHandler/RedirectHandlerTest.php b/tests/TestCase/Middleware/UnauthorizedHandler/RedirectHandlerTest.php index 7d65a888..b4491ebb 100644 --- a/tests/TestCase/Middleware/UnauthorizedHandler/RedirectHandlerTest.php +++ b/tests/TestCase/Middleware/UnauthorizedHandler/RedirectHandlerTest.php @@ -88,7 +88,7 @@ public function testHandleRedirectionNoQuery() $this->assertSame('/users/login', $response->getHeaderLine('Location')); } - public function httpMethodProvider() + public static function httpMethodProvider() { return [ ['POST'],