Skip to content

Commit

Permalink
Merge pull request #5328 from kenjis/update-rector-phpunit-rule
Browse files Browse the repository at this point in the history
[Rector] add PHPUnitSetList::PHPUNIT_80
  • Loading branch information
kenjis authored Nov 25, 2021
2 parents e05881b + 3cf95b5 commit 7c08819
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
use Rector\PHPUnit\Rector\MethodCall\AssertFalseStrposToContainsRector;
use Rector\PHPUnit\Rector\MethodCall\AssertIssetToSpecificMethodRector;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
Expand All @@ -57,6 +56,7 @@
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(LevelSetList::UP_TO_PHP_73);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$containerConfigurator->import(PHPUnitSetList::PHPUNIT_80);

$parameters = $containerConfigurator->parameters();

Expand Down Expand Up @@ -122,9 +122,6 @@
__DIR__ . '/tests/system/Entity/EntityTest.php',
__DIR__ . '/tests/system/Session/SessionTest.php',
],

// assertContains() to string can't be used in PHPUnit 9.1
AssertFalseStrposToContainsRector::class,
]);

// auto import fully qualified class names
Expand Down
4 changes: 2 additions & 2 deletions tests/system/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public function testJSONWithArray()
$response->setJSON($body);

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

public function testJSONGetFromNormalBody()
Expand Down Expand Up @@ -364,7 +364,7 @@ public function testXMLWithArray()
$response->setXML($body);

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

public function testXMLGetFromNormalBody()
Expand Down
4 changes: 2 additions & 2 deletions tests/system/View/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ public function testRenderLayoutWithInclude()

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

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

Expand Down

0 comments on commit 7c08819

Please sign in to comment.