Skip to content

Commit 69e0b36

Browse files
committed
Upgrade to PHPUnit v8.5
1 parent 993331b commit 69e0b36

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor
2-
/composer.lock
2+
/composer.lock
3+
.phpunit.result.cache

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"require-dev": {
1616
"composer/composer": "^1.0",
17-
"phpunit/phpunit": "^4.8|^5.7|^6.0",
17+
"phpunit/phpunit": "~8.5.0",
1818
"cakephp/cakephp-codesniffer": "^4.1"
1919
},
2020
"autoload": {

phpunit.xml.dist

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="tests/bootstrap.php"
1312
>
1413
<testsuites>
@@ -17,4 +16,4 @@
1716
</testsuite>
1817
</testsuites>
1918

20-
</phpunit>
19+
</phpunit>

tests/TestCase/Installer/PluginInstallerTest.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PluginInstallerTest extends TestCase
3737
*
3838
* @return void
3939
*/
40-
public function setUp()
40+
public function setUp(): void
4141
{
4242
parent::setUp();
4343
$this->package = new Package('CamelCased', '1.0', '1.0');
@@ -68,7 +68,7 @@ public function setUp()
6868
$this->installer = new PluginInstaller($this->io, $composer);
6969
}
7070

71-
public function tearDown()
71+
public function tearDown(): void
7272
{
7373
parent::tearDown();
7474
$dirs = array_reverse($this->testDirs);
@@ -265,24 +265,24 @@ public function testWriteConfigFile()
265265
$this->assertFileExists($path);
266266
$contents = file_get_contents($path);
267267

268-
$this->assertContains('<?php', $contents);
269-
$this->assertContains('$baseDir = dirname(dirname(__FILE__));', $contents);
270-
$this->assertContains(
268+
$this->assertStringContainsString('<?php', $contents);
269+
$this->assertStringContainsString('$baseDir = dirname(dirname(__FILE__));', $contents);
270+
$this->assertStringContainsString(
271271
"'Fee' => \$baseDir . '/plugins/Fee/'",
272272
$contents,
273273
'paths should be relative for app-plugins'
274274
);
275-
$this->assertContains(
275+
$this->assertStringContainsString(
276276
"'Princess' => \$baseDir . '/vendor/cakephp/princess/'",
277277
$contents,
278278
'paths should be relative for vendor-plugins'
279279
);
280-
$this->assertContains(
280+
$this->assertStringContainsString(
281281
"'OddOneOut' => '/some/other/path/'",
282282
$contents,
283283
'paths should stay absolute if it\'s not under the application root'
284284
);
285-
$this->assertContains(
285+
$this->assertStringContainsString(
286286
"'Vendor/Plugin' => \$baseDir . '/vendor/vendor/plugin/'",
287287
$contents,
288288
'Plugin namespaces should use forward slash'
@@ -308,9 +308,9 @@ public function testUpdateConfigNoConfigFile()
308308
$this->installer->updateConfig('DebugKit', '/vendor/cakephp/DebugKit');
309309
$this->assertFileExists($this->path . '/vendor/cakephp-plugins.php');
310310
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
311-
$this->assertContains('<?php', $contents);
312-
$this->assertContains("'plugins' =>", $contents);
313-
$this->assertContains("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
311+
$this->assertStringContainsString('<?php', $contents);
312+
$this->assertStringContainsString("'plugins' =>", $contents);
313+
$this->assertStringContainsString("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
314314
}
315315

316316
public function testUpdateConfigAddPathInvalidFile()
@@ -331,10 +331,10 @@ public function testUpdateConfigAddPathFileExists()
331331

332332
$this->installer->updateConfig('DebugKit', '/vendor/cakephp/DebugKit');
333333
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
334-
$this->assertContains('<?php', $contents);
335-
$this->assertContains("'plugins' =>", $contents);
336-
$this->assertContains("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
337-
$this->assertContains("'Bake' => '/some/path/'", $contents);
334+
$this->assertStringContainsString('<?php', $contents);
335+
$this->assertStringContainsString("'plugins' =>", $contents);
336+
$this->assertStringContainsString("'DebugKit' => '/vendor/cakephp/DebugKit/'", $contents);
337+
$this->assertStringContainsString("'Bake' => '/some/path/'", $contents);
338338
}
339339

340340
/**
@@ -351,10 +351,10 @@ public function testUpdateConfigAddRootPath()
351351

352352
$this->installer->updateConfig('DebugKit', $this->path . '/vendor/cakephp/debugkit');
353353
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
354-
$this->assertContains('<?php', $contents);
355-
$this->assertContains('$baseDir = dirname(dirname(__FILE__));', $contents);
356-
$this->assertContains("'DebugKit' => \$baseDir . '/vendor/cakephp/debugkit/'", $contents);
357-
$this->assertContains("'Bake' => '/some/path/'", $contents);
354+
$this->assertStringContainsString('<?php', $contents);
355+
$this->assertStringContainsString('$baseDir = dirname(dirname(__FILE__));', $contents);
356+
$this->assertStringContainsString("'DebugKit' => \$baseDir . '/vendor/cakephp/debugkit/'", $contents);
357+
$this->assertStringContainsString("'Bake' => '/some/path/'", $contents);
358358
}
359359

360360
/**
@@ -373,10 +373,10 @@ public function testUpdateConfigAddPath()
373373
$this->installer->updateConfig('ADmad\JwtAuth', '/vendor/admad/cakephp-jwt-auth');
374374

375375
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
376-
$this->assertContains('<?php', $contents);
377-
$this->assertContains("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
378-
$this->assertContains("'Bake' => '/some/path/'", $contents);
379-
$this->assertContains("'ADmad/JwtAuth' => '/vendor/admad/cakephp-jwt-auth/'", $contents);
376+
$this->assertStringContainsString('<?php', $contents);
377+
$this->assertStringContainsString("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
378+
$this->assertStringContainsString("'Bake' => '/some/path/'", $contents);
379+
$this->assertStringContainsString("'ADmad/JwtAuth' => '/vendor/admad/cakephp-jwt-auth/'", $contents);
380380
}
381381

382382
/**
@@ -394,8 +394,8 @@ public function testUpdateConfigAddPathWindows()
394394
$this->installer->updateConfig('DebugKit', '\vendor\cakephp\debugkit');
395395

396396
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
397-
$this->assertContains('<?php', $contents);
398-
$this->assertContains("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
397+
$this->assertStringContainsString('<?php', $contents);
398+
$this->assertStringContainsString("'DebugKit' => '/vendor/cakephp/debugkit/'", $contents);
399399
}
400400

401401
/**
@@ -412,8 +412,8 @@ public function testUpdateConfigRemovePath()
412412

413413
$this->installer->updateConfig('Bake', '');
414414
$contents = file_get_contents($this->path . '/vendor/cakephp-plugins.php');
415-
$this->assertContains('<?php', $contents);
416-
$this->assertContains("'plugins' =>", $contents);
417-
$this->assertNotContains("Bake", $contents);
415+
$this->assertStringContainsString('<?php', $contents);
416+
$this->assertStringContainsString("'plugins' =>", $contents);
417+
$this->assertStringNotContainsString("Bake", $contents);
418418
}
419419
}

0 commit comments

Comments
 (0)