Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Rector\PHPUnit\Tests\PHPUnit90\Rector\MethodCall\SpecificAssertContainsWithoutIdentityRector\Fixture;

use PHPUnit\Framework\TestCase;
use stdClass;

final class SkipNoSecondArg extends TestCase
{
public function test()
{
$objects = [ new stdClass(), new stdClass(), new stdClass() ];
$this->transport()->queue()->assertContains(new stdClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public function refactor(Node $node): ?Node
return null;
}

if (count($node->getArgs()) < 2) {
return null;
}

// when second argument is string: do nothing
$secondArgType = $this->getType($node->getArgs()[1]->value);
if ($secondArgType instanceof StringType) {
Expand Down
Loading