beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

Add min max count assertions #267

Closed Taluu closed 5 years ago

rquadling commented 5 years ago

Either at least and at most, or no fewer and no more.

rquadling commented 5 years ago

Sorry. Clicked close rather than comment.

Taluu commented 5 years ago

Np. :}

I went for at least and at most then.

rquadling commented 5 years ago

And some unit tests please. Prove that it all works.

Taluu commented 5 years ago

I also thought about adding tests, but I saw that none of the current assertions have those, so I wasn't sure on how to test it.

Should I create a new assertion test case then ?

rquadling commented 5 years ago

I also thought about adding tests, but I saw that none of the current assertions have those, so I wasn't sure on how to test it.

Should I create a new assertion test case then ?

https://github.com/beberlei/assert/blob/master/tests/Assert/Tests/AssertTest.php

rquadling commented 5 years ago

We currently have 100% code coverage, so, yes, tests please!!!

rquadling commented 5 years ago

I do need to break the tests up into logical/associated assertions to make this all a little easier to see.

Taluu commented 5 years ago

AssertTest should also be renamed (before splitting it ?) to AssertionTest so that it is quicker and easier to map it.

I'll add the tests then and do the same for the other PRs.

rquadling commented 5 years ago

Thank you.

Taluu commented 5 years ago

Tested added everywhere. :}

rquadling commented 5 years ago

I'll look at this later today or during the weekend.

rquadling commented 5 years ago

Taken your code and incorporated the additional countable types into the doc block typehint and unit tests.