Skip to content

Conversation

samsonasik
Copy link
Member

@TomasVotruba this is another alternative solution to not change to assertEquals for failure test https://github.com/rectorphp/rector-phpunit/actions/runs/17128495249/job/48586074883#step:5:43

this however, not make sense, because existing assertSame already failure before rector apply:

class SomeTest extends TestCase
{
    public function test()
    {
        $this->assertSame('123', $this->getOrderId());
    }

    private function getOrderId(): int
    {
        return 123;
    }
}
There was 1 failure:

1) ArrayLookup\Tests\CollectorTest::test
Failed asserting that 123 is identical to '123'.

assertSame is works on identical value, so it already error on the first execution, which means user already know that and patch first before run the rector, so the rule doesn't make any improvement imo.

@TomasVotruba
Copy link
Member

I picked #520, thanks

@samsonasik samsonasik deleted the alternative2-skip-assert-equals branch August 22, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants