Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Rector\Tests\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector\Fixture;

use PHPUnit\Framework\TestCase;

final class CreateStubInTest extends TestCase
{
public function test($params)
{
$user = $this->createStub('SomeClass');
}
}

?>
-----
<?php

namespace Rector\Tests\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector\Fixture;

use PHPUnit\Framework\TestCase;

final class CreateStubInTest extends TestCase
{
public function test($params)
{
}
}

?>
2 changes: 1 addition & 1 deletion rules/DeadCode/SideEffect/SideEffectNodeDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private function isTestMock(MethodCall|StaticCall $node): bool
return false;
}

return $this->nodeNameResolver->isName($node->name, 'createMock');
return $this->nodeNameResolver->isNames($node->name, ['createMock', 'createStub']);
}

private function isPhpParser(New_ $new): bool
Expand Down
Loading