Skip to content

Conversation

@samsonasik
Copy link
Member

Closes #531

biozshock and others added 2 commits September 2, 2025 12:31
Fixture to test proper refactoring of PHPUnit assertion.
@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @biozshock

@samsonasik samsonasik marked this pull request as draft September 2, 2025 11:02
@samsonasik samsonasik marked this pull request as ready for review September 2, 2025 11:06
@samsonasik
Copy link
Member Author

Should be ok, since argument is flipped.

Comment on lines 29 to 30
$this->assertLessThan(2, count($something));
$this->assertLessThan($something[1]['foo'], $something[0]['foo']);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems invalid

        $something = [
            0 => [
                'foo' => 2,
            ],
            1 => [
                'foo' => 1,
            ],
            'bar',
        ];

        $this->assertTrue(count($something) > 2);
        $this->assertTrue($something[0]['foo'] > $something[1]['foo']);

        $this->assertLessThan(2, count($something));
        $this->assertLessThan($something[1]['foo'], $something[0]['foo']);

got:

There was 1 failure:

1) ArrayLookup\Tests\FilterTest::test
Failed asserting that 3 is less than 2.

/Users/samsonasik/www/GithubModules/ArrayLookup/tests/FilterTest.php:168

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it, when on Greater, GreaterOrEqual, Smaller, SmallerOrEqual, order of argument should be kept to avoid invalid comparison 58115fd

@samsonasik samsonasik marked this pull request as draft September 2, 2025 11:15
@samsonasik samsonasik marked this pull request as ready for review September 2, 2025 11:26
@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 1947a57 into main Sep 2, 2025
6 checks passed
@samsonasik samsonasik deleted the close-531 branch September 2, 2025 11:28
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.

3 participants