| 1 | <?php |
||
| 2 | |||
| 3 | namespace Jalle19\StatusManager\Test\Database; |
||
| 4 | |||
| 5 | use Jalle19\StatusManager\Database\LimitTrait; |
||
| 6 | use PHPUnit\Framework\TestCase; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Class LimitTraitTest |
||
| 10 | * @package Jalle19\StatusManager\Test\Database |
||
| 11 | * @copyright Copyright © Sam Stenvall 2016- |
||
| 12 | * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0 |
||
| 13 | */ |
||
| 14 | class LimitTraitTest extends TestCase |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Tests that limit() is actually called correctly |
||
| 19 | */ |
||
| 20 | public function testTrait() |
||
| 21 | { |
||
| 22 | /* @var \PHPUnit_Framework_MockObject_MockObject|LimitTrait $mock */ |
||
| 23 | $mock = $this->getMockForTrait('\Jalle19\StatusManager\Database\LimitTrait'); |
||
| 24 | |||
| 25 | $mock->expects($this->once()) |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 26 | ->method('limit'); |
||
| 27 | |||
| 28 | $mock->filterByLimit(10); |
||
| 29 | |||
| 30 | $mock->expects($this->never()) |
||
| 31 | ->method('limit'); |
||
| 32 | |||
| 33 | $mock->filterByLimit(null); |
||
| 34 | } |
||
| 35 | |||
| 36 | } |
||
| 37 |