@@ -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