Completed
Push — master ( 9458ed...7d322b )
by Henry
10:04
created

UserTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 49
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testValidate() 0 14 1
A testGetPattern() 0 14 1
1
<?php
2
namespace Redaxscript\Tests\Validator;
3
4
use Redaxscript\Tests\TestCaseAbstract;
5
use Redaxscript\Validator;
6
7
/**
8
 * UserTest
9
 *
10
 * @since 4.3.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 *
16
 * @covers Redaxscript\Validator\User
17
 */
18
19
class UserTest extends TestCaseAbstract
20
{
21
	/**
22
	 * testGetPattern
23
	 *
24
	 * @since 4.3.0
25
	 */
26
27
	public function testGetPattern() : void
28
	{
29
		/* setup */
30
31
		$validator = new Validator\User();
32
33
		/* actual */
34
35
		$actual = $validator->getPattern();
36
37
		/* compare */
38
39
		$this->assertIsString($actual);
40
	}
41
42
	/**
43
	 * testValidate
44
	 *
45
	 * @since 4.3.0
46
	 *
47
	 * @param string $user
48
	 * @param bool $expect
49
	 *
50
	 * @dataProvider providerAutoloader
51
	 */
52
53
	public function testValidate(string $user = null, bool $expect = null) : void
54
	{
55
		/* setup */
56
57
		$validator = new Validator\User();
58
59
		/* actual */
60
61
		$actual = $validator->validate($user);
62
63
		/* compare */
64
65
		$this->assertEquals($expect, $actual);
66
	}
67
}
68