Skip to content

Commit 7c08819

Browse files
authored
Merge pull request #5328 from kenjis/update-rector-phpunit-rule
[Rector] add PHPUnitSetList::PHPUNIT_80
2 parents e05881b + 3cf95b5 commit 7c08819

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

rector.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
4343
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
4444
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
45-
use Rector\PHPUnit\Rector\MethodCall\AssertFalseStrposToContainsRector;
4645
use Rector\PHPUnit\Rector\MethodCall\AssertIssetToSpecificMethodRector;
4746
use Rector\PHPUnit\Set\PHPUnitSetList;
4847
use Rector\Set\ValueObject\LevelSetList;
@@ -57,6 +56,7 @@
5756
$containerConfigurator->import(SetList::DEAD_CODE);
5857
$containerConfigurator->import(LevelSetList::UP_TO_PHP_73);
5958
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
59+
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_80);
6060

6161
$parameters = $containerConfigurator->parameters();
6262

@@ -122,9 +122,6 @@
122122
__DIR__ . '/tests/system/Entity/EntityTest.php',
123123
__DIR__ . '/tests/system/Session/SessionTest.php',
124124
],
125-
126-
// assertContains() to string can't be used in PHPUnit 9.1
127-
AssertFalseStrposToContainsRector::class,
128125
]);
129126

130127
// auto import fully qualified class names

tests/system/HTTP/ResponseTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testJSONWithArray()
327327
$response->setJSON($body);
328328

329329
$this->assertSame($expected, $response->getJSON());
330-
$this->assertNotFalse(strpos($response->getHeaderLine('content-type'), 'application/json'));
330+
$this->assertStringContainsString('application/json', $response->getHeaderLine('content-type'));
331331
}
332332

333333
public function testJSONGetFromNormalBody()
@@ -364,7 +364,7 @@ public function testXMLWithArray()
364364
$response->setXML($body);
365365

366366
$this->assertSame($expected, $response->getXML());
367-
$this->assertNotFalse(strpos($response->getHeaderLine('content-type'), 'application/xml'));
367+
$this->assertStringContainsString('application/xml', $response->getHeaderLine('content-type'));
368368
}
369369

370370
public function testXMLGetFromNormalBody()

tests/system/View/ViewTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ public function testRenderLayoutWithInclude()
316316

317317
$content = $view->render('extend_include');
318318

319-
$this->assertNotFalse(strpos($content, '<p>Open</p>'));
320-
$this->assertNotFalse(strpos($content, '<h1>Hello World</h1>'));
319+
$this->assertStringContainsString('<p>Open</p>', $content);
320+
$this->assertStringContainsString('<h1>Hello World</h1>', $content);
321321
$this->assertSame(2, substr_count($content, 'Hello World'));
322322
}
323323

0 commit comments

Comments
 (0)