mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-23 03:02:33 +01:00
Merge pull request #788 from rectorphp/phpunit/iterator-count
[PHPUnit] Convert iterator_count into assertCount
This commit is contained in:
commit
ae37c40e37
@ -18,6 +18,7 @@ final class AssertCompareToSpecificMethodRector extends AbstractPHPUnitRector
|
||||
private $defaultOldToNewMethods = [
|
||||
'count' => ['assertCount', 'assertNotCount'],
|
||||
'sizeof' => ['assertCount', 'assertNotCount'],
|
||||
'iterator_count' => ['assertCount', 'assertNotCount'],
|
||||
'gettype' => ['assertInternalType', 'assertNotInternalType'],
|
||||
'get_class' => ['assertInstanceOf', 'assertNotInstanceOf'],
|
||||
];
|
||||
|
@ -5,6 +5,7 @@ final class MyTest extends \PHPUnit\Framework\TestCase
|
||||
public function test()
|
||||
{
|
||||
$this->assertCount(5, $something);
|
||||
$this->assertCount(10, $something);
|
||||
$this->assertNotCount($count, $something, 'third argument');
|
||||
$this->assertInternalType('string', $something);
|
||||
$this->assertEquals('string', $something['property']());
|
||||
|
@ -5,6 +5,7 @@ final class MyTest extends \PHPUnit\Framework\TestCase
|
||||
public function test()
|
||||
{
|
||||
$this->assertSame(5, count($something));
|
||||
$this->assertEquals(10, iterator_count($something));
|
||||
$this->assertNotEquals($count, sizeof($something), 'third argument');
|
||||
$this->assertEquals('string', gettype($something));
|
||||
$this->assertEquals('string', $something['property']());
|
||||
|
Loading…
x
Reference in New Issue
Block a user