Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condense assertions #232

Closed
wants to merge 3 commits into from
Closed

Condense assertions #232

wants to merge 3 commits into from

Conversation

SvenRtbg
Copy link
Contributor

Use assertSame to validate both type and value in one step. Use assertCount to check number of array elements. Use assertContainsOnly(InstanceOf) to check type of array elements.

Tiny cleanup for tests that are only run for PHP 7.0 or 7.1 and up, as they need no check for the PHP version anymore.

Call assertions via "$this" everywhere.

Use assertSame to validate both type and value in one step.
Use assertCount to check number of array elements.
Use assertContainsOnly(InstanceOf) to check type of array elements.

Tiny cleanup for tests that are only run for PHP 7.0 or 7.1 and up,
as they need no check for the PHP version anymore.

Call assertions via "$this" everywhere.
Was never verified using the non-existing second parameter of expectException()
Copy link
Contributor Author

@SvenRtbg SvenRtbg left a comment

Choose a reason for hiding this comment

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

That will happen next week

tests/ArrayTest.php Outdated Show resolved Hide resolved
tests/ArrayTest.php Outdated Show resolved Hide resolved
tests/ArrayTest.php Show resolved Hide resolved
tests/ArrayTest.php Outdated Show resolved Hide resolved
tests/ArrayTest.php Outdated Show resolved Hide resolved
tests/ArrayTest.php Outdated Show resolved Hide resolved
@cweiske cweiske marked this pull request as draft April 14, 2024 09:55
@SvenRtbg SvenRtbg marked this pull request as ready for review April 23, 2024 08:38
@cweiske cweiske closed this in 10aceb9 May 16, 2024
@cweiske
Copy link
Owner

cweiske commented May 16, 2024

Thanks!
I've split them into single commits because I found them hard to review.

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