Skip to content

Commit

Permalink
upgrade phpunit to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
skie committed Jun 7, 2023
1 parent b917f4f commit b8c5187
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"require-dev": {
"cakephp/cakephp-codesniffer": "~4.4.0",
"league/flysystem-vfs": "^1.0",
"phpunit/phpunit": "^9.5.16",
"phpunit/phpunit": "^10.0",
"vlucas/phpdotenv": "^3.3"
},
"autoload": {
Expand Down
16 changes: 9 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" processIsolation="false" stopOnFailure="false" bootstrap="./tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd">
<coverage includeUncoveredFiles="true"/>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
<env name="db_dsn" value="mysql://root2:root2@localhost/cake_test_db"/>
<env name="FIXTURE_SCHEMA_METADATA" value="./tests/schema.php"/>
</php>
<!-- Add any additional test suites you want to run here -->
Expand All @@ -18,7 +15,12 @@
</testsuites>
<!-- Setup a listener for fixtures -->
<extensions>
<extension class="\Cake\TestSuite\Fixture\PHPUnitExtension"/>
<bootstrap class="Cake\TestSuite\Fixture\Extension\PHPUnitExtension"/>
</extensions>
<!-- Prevent coverage reports from looking in tests and vendors -->
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
10 changes: 5 additions & 5 deletions tests/TestCase/Service/Renderer/FlysystemRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testRendererInitializeByClassName()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand All @@ -93,7 +93,7 @@ public function testRendererSuccess()

$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -141,7 +141,7 @@ public function testRendereFileNotFound()
Configure::write('debug', false);
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -192,7 +192,7 @@ public function testRendererError()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -229,7 +229,7 @@ public function testRendererErrorEmptyExceptionCode()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Service/Renderer/JSendRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testRendererInitializeByClassName()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand All @@ -88,7 +88,7 @@ public function testRendererSuccess()
Configure::write('debug', false);
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();
$this->_initializeRequest([], 'GET', ['response' => $response]);
$serviceOptions = [
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testRendererError()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Service/Renderer/JsonRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testRendererInitializeByClassName()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand All @@ -88,7 +88,7 @@ public function testRendererSuccess()
Configure::write('debug', false);
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -132,7 +132,7 @@ public function testRendererError()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Service/Renderer/RawRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testRendererInitializeByClassName()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand All @@ -87,7 +87,7 @@ public function testRendererSuccess()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testRendererError()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Service/Renderer/XmlRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testRendererInitializeByClassName()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand All @@ -87,7 +87,7 @@ public function testRendererSuccess()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testRendererError()
{
$response = $this
->getMockBuilder(\Cake\Http\Response::class)
->setMethods(['withStatus', 'withType', 'withStringBody'])
->onlyMethods(['withStatus', 'withType', 'withStringBody'])
->getMock();

$this->_initializeRequest([], 'GET', ['response' => $response]);
Expand Down

0 comments on commit b8c5187

Please sign in to comment.