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

NameTest::testValidate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 2
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\Name
17
 */
18
19
class NameTest 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\Name();
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 $name
48
	 * @param bool $expect
49
	 *
50
	 * @dataProvider providerAutoloader
51
	 */
52
53
	public function testValidate(string $name = null, bool $expect = null) : void
54
	{
55
		/* setup */
56
57
		$validator = new Validator\Name();
58
59
		/* actual */
60
61
		$actual = $validator->validate($name);
62
63
		/* compare */
64
65
		$this->assertEquals($expect, $actual);
66
	}
67
}
68