Skip to content

Commit a4e65e0

Browse files
authored
Merge pull request #240 from cakephp/3.x-phpunit10
3.x: upgrade to PHPUnit 10
2 parents 612fd58 + 4c010b1 commit a4e65e0

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/tmp
66
/tools
77
/vendor
8-
.phpunit.result.cache
8+
.phpunit.cache
99

1010
# OS generated files #
1111
######################

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"cakephp/cakephp": "5.x-dev",
2323
"cakephp/cakephp-codesniffer": "^5.0",
2424
"cakephp/plugin-installer": "^1.3",
25-
"phpunit/phpunit": "^9.5"
25+
"phpunit/phpunit": "^10.1.0"
2626
},
2727
"suggest": {
2828
"cakephp/http": "To use \"RequestPolicyInterface\" (Not needed separately if using full CakePHP framework).",

phpunit.xml.dist

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
colors="true"
4-
bootstrap="tests/bootstrap.php"
5-
backupGlobals="true"
6-
convertDeprecationsToExceptions="true"
7-
>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
colors="true"
4+
backupGlobals="true"
5+
cacheDirectory=".phpunit.cache"
6+
bootstrap="tests/bootstrap.php"
7+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
8+
>
89

910
<!-- Add any additional test suites you want to run here -->
1011
<testsuites>
@@ -15,14 +16,14 @@
1516
</testsuites>
1617

1718
<extensions>
18-
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
19+
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
1920
</extensions>
2021

21-
<coverage>
22+
<source>
2223
<include>
2324
<directory suffix=".php">src/</directory>
2425
</include>
25-
</coverage>
26+
</source>
2627

2728
<php>
2829
<ini name="memory_limit" value="-1"/>

tests/TestCase/AuthorizationServiceTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ public function testBeforeFalse()
301301
$entity = new Article();
302302

303303
$policy = $this->getMockBuilder(BeforePolicyInterface::class)
304-
->setMethods(['before', 'canAdd'])
304+
->onlyMethods(['before'])
305+
->addMethods(['canAdd'])
305306
->getMock();
306307

307308
$policy->expects($this->once())
@@ -331,7 +332,8 @@ public function testBeforeTrue()
331332
$entity = new Article();
332333

333334
$policy = $this->getMockBuilder(BeforePolicyInterface::class)
334-
->setMethods(['before', 'canAdd'])
335+
->onlyMethods(['before'])
336+
->addMethods(['canAdd'])
335337
->getMock();
336338

337339
$policy->expects($this->once())
@@ -361,7 +363,8 @@ public function testBeforeNull()
361363
$entity = new Article();
362364

363365
$policy = $this->getMockBuilder(BeforePolicyInterface::class)
364-
->setMethods(['before', 'canAdd'])
366+
->onlyMethods(['before'])
367+
->addMethods(['canAdd'])
365368
->getMock();
366369

367370
$policy->expects($this->once())
@@ -393,7 +396,8 @@ public function testBeforeResultTrue()
393396
$entity = new Article();
394397

395398
$policy = $this->getMockBuilder(BeforePolicyInterface::class)
396-
->setMethods(['before', 'canAdd'])
399+
->onlyMethods(['before'])
400+
->addMethods(['canAdd'])
397401
->getMock();
398402

399403
$policy->expects($this->once())
@@ -423,7 +427,8 @@ public function testBeforeResultFalse()
423427
$entity = new Article();
424428

425429
$policy = $this->getMockBuilder(BeforePolicyInterface::class)
426-
->setMethods(['before', 'canAdd'])
430+
->onlyMethods(['before'])
431+
->addMethods(['canAdd'])
427432
->getMock();
428433

429434
$policy->expects($this->once())

tests/TestCase/IdentityDecoratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class IdentityDecoratorTest extends TestCase
1818
{
19-
public function constructorDataProvider()
19+
public static function constructorDataProvider()
2020
{
2121
return [
2222
'array' => [

tests/TestCase/Middleware/UnauthorizedHandler/RedirectHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testHandleRedirectionNoQuery()
8888
$this->assertSame('/users/login', $response->getHeaderLine('Location'));
8989
}
9090

91-
public function httpMethodProvider()
91+
public static function httpMethodProvider()
9292
{
9393
return [
9494
['POST'],

0 commit comments

Comments
 (0)