Issues (28)

tests/cli/Database/LimitTraitTest.php (1 issue)

Labels
Severity
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 &copy; 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
It seems like expects() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
		$mock->/** @scrutinizer ignore-call */ 
26
         expects($this->once())
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