Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/tmp
/tools
/vendor
.phpunit.result.cache
.phpunit.cache

# OS generated files #
######################
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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).",
Expand Down
19 changes: 10 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
bootstrap="tests/bootstrap.php"
backupGlobals="true"
convertDeprecationsToExceptions="true"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
colors="true"
backupGlobals="true"
cacheDirectory=".phpunit.cache"
bootstrap="tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
>

<!-- Add any additional test suites you want to run here -->
<testsuites>
Expand All @@ -15,14 +16,14 @@
</testsuites>

<extensions>
<extension class="Cake\TestSuite\Fixture\PHPUnitExtension"/>
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>

<coverage>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
</source>

<php>
<ini name="memory_limit" value="-1"/>
Expand Down
15 changes: 10 additions & 5 deletions tests/TestCase/AuthorizationServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/IdentityDecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class IdentityDecoratorTest extends TestCase
{
public function constructorDataProvider()
public static function constructorDataProvider()
{
return [
'array' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function testHandleRedirectionNoQuery()
$this->assertSame('/users/login', $response->getHeaderLine('Location'));
}

public function httpMethodProvider()
public static function httpMethodProvider()
{
return [
['POST'],
Expand Down