Add failing test case for StringToArrayArgumentProcessRectorTest about Traversable.

This commit is contained in:
Dorian Villet 2019-10-02 14:29:10 +02:00
parent 946ef1e9c2
commit 6ab3ee9a67
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace Rector\Symfony\Tests\Rector\New_\StringToArrayArgumentProcessRector\Fixture;
final class TraversableClass implements \IteratorAggregate
{
public function someMethod($arg1, $arg2)
{
}
public function getIterator()
{
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace Rector\Symfony\Tests\Rector\New_\StringToArrayArgumentProcessRector\Fixture;
class TestClass
{
public function foo(): void
{
(new TraversableClass())->someMethod('some string that should remain a string', ['test_key' => 'test value']);
}
}

View File

@ -24,6 +24,7 @@ final class StringToArrayArgumentProcessRectorTest extends AbstractRectorTestCas
yield [__DIR__ . '/Fixture/fixture4.php.inc'];
yield [__DIR__ . '/Fixture/with_sprintf.php.inc'];
yield [__DIR__ . '/Fixture/skip_anonymous_class.php.inc'];
yield [__DIR__ . '/Fixture/skip_class_extending_traversable.php.inc'];
}
protected function getRectorClass(): string