-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHelpersEscapeUnitTest.php
More file actions
80 lines (75 loc) · 1.65 KB
/
HelpersEscapeUnitTest.php
File metadata and controls
80 lines (75 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* Unit test class for HelpersEscape sniff.
*
* @package EightshiftCS
*
* @author Eightshift <team.wordpress@infinum.com>
* @license https://opensource.org/licenses/MIT MIT
* @link https://github.com/infinum/eightshift-coding-standards
*/
namespace EightshiftCS\Eightshift\Tests\Security;
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
/**
* Unit test class for the HelpersEscape sniff.
*
* @covers \EightshiftCS\Eightshift\Sniffs\Security\HelpersEscapeSniff
*
* @since 1.4.0 Added $testFile parameter.
*/
class HelpersEscapeUnitTest extends AbstractSniffUnitTest
{
/**
* Returns the lines where errors should occur.
*
* @param string $testFile The name of the file being tested.
*
* @return array<int, int> Key is the line number, value is the number of expected errors.
*/
public function getErrorList(string $testFile = ''): array
{
switch ($testFile) {
case 'HelpersEscapeUnitTest.1.inc':
return [
21 => 1,
23 => 1,
];
case 'HelpersEscapeUnitTest.2.inc':
return [
3 => 1,
10 => 1,
17 => 1
];
case 'HelpersEscapeUnitTest.3.inc':
return [
12 => 1,
19 => 1,
24 => 1,
];
case 'HelpersEscapeUnitTest.4.inc':
return [
102 => 1,
];
case 'HelpersEscapeUnitTest.5.inc':
return [
25 => 1,
149 => 1,
];
case 'HelpersEscapeUnitTest.6.inc':
return [
5 => 1,
];
default:
return [];
}
}
/**
* Returns the lines where warnings should occur.
*
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList(): array
{
return [];
}
}