zendframework / zend-paginator

Paginate collections of data from arbitrary sources.
BSD 3-Clause "New" or "Revised" License
36 stars 30 forks source link

#22 avoid repetitive call $this->_calculatePageCount() in count() method if count equals zero #26

Closed fedys closed 6 years ago

fedys commented 8 years ago

22

froschdesign commented 8 years ago

Duplicates #25

fedys commented 8 years ago

@froschdesign you are right my PR is duplicating #25 but my PR contains tests which tests the repetitive call of Zend\Paginator\Paginator::_calculatePageCount() unlike the PR #25. Please consider merging of my ZendTest\Paginator\PaginatorTest::testRepetitiveCallCountResultingZeroDoesNotCauseRepetitiveCallOfCalculatePageCountMethod()

froschdesign commented 8 years ago

I've seen it and I prefer your test in this special case.

fedys commented 8 years ago

thanks :)

froschdesign commented 8 years ago

@fedys Can you simplify the test method name? Maybe replace "RepetitiveCallCountResultingZero" with "CountResultOfZero" or something shorter.

weierophinney commented 6 years ago

Can you simplify the test method name?

Just a note: as a general rule, the more descriptive the name, the better. Test names should indicate the behavior being tested.

weierophinney commented 6 years ago

Thanks, @fedys!