AliasTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 75
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testValidate() 0 14 1
A testGetPattern() 0 14 1
A testMatchSystem() 0 14 1
1
<?php
2
namespace Redaxscript\Tests\Validator;
3
4
use Redaxscript\Tests\TestCaseAbstract;
5
use Redaxscript\Validator;
6
7
/**
8
 * AliasTest
9
 *
10
 * @since 2.2.0
11
 *
12
 * @package Redaxscript
13
 * @category Tests
14
 * @author Henry Ruhs
15
 * @author Sven Weingartner
16
 *
17
 * @covers Redaxscript\Validator\Alias
18
 */
19
20
class AliasTest extends TestCaseAbstract
21
{
22
	/**
23
	 * testGetPattern
24
	 *
25
	 * @since 4.3.0
26
	 */
27
28
	public function testGetPattern() : void
29
	{
30
		/* setup */
31
32
		$validator = new Validator\Alias();
33
34
		/* actual */
35
36
		$actual = $validator->getPattern();
37
38
		/* compare */
39
40
		$this->assertIsString($actual);
41
	}
42
43
	/**
44
	 * testValidate
45
	 *
46
	 * @since 4.3.0
47
	 *
48
	 * @param string $alias
49
	 * @param bool $expect
50
	 *
51
	 * @dataProvider providerAutoloader
52
	 */
53
54
	public function testValidate(string $alias = null, bool $expect = null) : void
55
	{
56
		/* setup */
57
58
		$validator = new Validator\Alias();
59
60
		/* actual */
61
62
		$actual = $validator->validate($alias);
63
64
		/* compare */
65
66
		$this->assertEquals($expect, $actual);
67
	}
68
69
	/**
70
	 * testMatchSystem
71
	 *
72
	 * @since 4.3.0
73
	 *
74
	 * @param string $alias
75
	 * @param bool $expect
76
	 *
77
	 * @dataProvider providerAutoloader
78
	 */
79
80
	public function testMatchSystem(string $alias = null, bool $expect = null) : void
81
	{
82
		/* setup */
83
84
		$validator = new Validator\Alias();
85
86
		/* actual */
87
88
		$actual = $validator->matchSystem($alias);
89
90
		/* compare */
91
92
		$this->assertEquals($expect, $actual);
93
	}
94
}
95