Completed
Push — master ( 6e7141...c85fa9 )
by Sam
02:48
created

UserQueryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 27
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFilterIgnoredUsers() 0 19 1
1
<?php
2
3
namespace Jalle19\StatusManager\Test\Database;
4
5
use Jalle19\StatusManager\Database\UserQuery;
6
7
/**
8
 * Class UserQueryTest
9
 * @package   Jalle19\StatusManager\Test\Database
10
 * @copyright Copyright &copy; Sam Stenvall 2016-
11
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
12
 */
13
class UserQueryTest extends \PHPUnit_Framework_TestCase
14
{
15
16
	/**
17
	 *
18
	 */
19
	public function testFilterIgnoredUsers()
20
	{
21
		/* @var \PHPUnit_Framework_MockObject_MockObject|UserQuery $mock */
22
		$mock = $this->getMockBuilder(UserQuery::class)
23
		             ->setMethods(['filterByName'])
24
		             ->getMock();
25
26
		// There should be four filter calls for three passed names, since the DVR user is added transparently
27
		$mock->expects($this->exactly(4))
28
		     ->method('filterByName');
29
30
		$ignoredUsers = [
31
			'foo',
32
			'bar',
33
			'baz',
34
		];
35
36
		$mock->filterIgnoredUsers($ignoredUsers);
37
	}
38
39
}
40