add test case for #743

This commit is contained in:
Tomas Votruba 2018-10-30 19:13:39 +01:00
parent bc0406e763
commit d825640717
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Php\Tests\Rector\FuncCall\CountOnNullRector\Wrong;
$result = [];
$nodes = [];
foreach ($nodes as $node) {
$result[] = [
'children' => $node->hasChildren(),
'id' => $node['id'],
];
}

View File

@ -24,6 +24,7 @@ final class CountOnNullRectorTest extends AbstractRectorTestCase
yield [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'];
yield [__DIR__ . '/Wrong/wrong3.php.inc', __DIR__ . '/Correct/correct3.php.inc'];
yield [__DIR__ . '/Wrong/wrong4.php.inc', __DIR__ . '/Correct/correct4.php.inc'];
yield [__DIR__ . '/Wrong/wrong5.php.inc', __DIR__ . '/Correct/correct5.php.inc'];
}
protected function provideConfig(): string

View File

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
namespace Rector\Php\Tests\Rector\FuncCall\CountOnNullRector\Wrong;
$result = [];
$nodes = [];
foreach ($nodes as $node) {
$result[] = [
'children' => $node->hasChildren(),
'id' => $node['id'],
];
}