Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

AssertCount - strict test #9

Closed
SpacePossum opened this issue Jul 10, 2017 · 5 comments
Closed

AssertCount - strict test #9

SpacePossum opened this issue Jul 10, 2017 · 5 comments

Comments

@SpacePossum
Copy link

Only allow AssertCount with expected int > 0, current PHPUnit checks int only.
In theory a Countable can return a negative number, however this should never be considered valid (i.e. abuse of the interface)

@keradus
Copy link
Member

keradus commented Jul 11, 2017

👍
but imo

-int > 0
+int >= 0

@keradus
Copy link
Member

keradus commented Jul 11, 2017

Adressed in #10

@SpacePossum
Copy link
Author

Ah yes typo, good catch.
Beside testing the given expected value you can also test the count returned by a \Countable object for being >=0. Than as a second issue, you could even go as far as testing the assertGreaterThan for not -INF (and the counter part LessThan). But these are all a bit of edge cases.

@SpacePossum
Copy link
Author

closing as #10 is on its way :) 👍

@keradus
Copy link
Member

keradus commented Jul 17, 2017

passed countable object is not part of phpunit, imo outside of scope of this project
checking ! -INF is really edgeeee case ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants