Passed
Pull Request — master (#184)
by Xaver
02:49
created

AlphabeticalUseStatementsUnitTest::getErrorList()   B

Complexity

Conditions 8
Paths 8

Size

Total Lines 44
Code Lines 33

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 8
eloc 33
c 1
b 0
f 0
nc 8
nop 1
dl 0
loc 44
rs 8.1475
1
<?php
2
3
/**
4
 * This file is part of the mo4-coding-standard (phpcs standard)
5
 *
6
 * @author  Xaver Loppenstedt <[email protected]>
7
 *
8
 * @license http://spdx.org/licenses/MIT MIT License
9
 *
10
 * @link    https://github.com/mayflower/mo4-coding-standard
11
 */
12
13
declare(strict_types=1);
14
15
namespace MO4\Tests\Formatting;
16
17
use MO4\Tests\AbstractMo4SniffUnitTest;
18
19
/**
20
 * Unit test class for the AlphabeticalUseStatements sniff.
21
 *
22
 * A sniff unit test checks a .inc file for expected violations of a single
23
 * coding standard. Expected errors and warnings are stored in this class.
24
 *
25
 * @author    Xaver Loppenstedt <[email protected]>
26
 *
27
 * @copyright 2013-2021 Xaver Loppenstedt, some rights reserved.
28
 *
29
 * @license   http://spdx.org/licenses/MIT MIT License
30
 *
31
 * @link      https://github.com/mayflower/mo4-coding-standard
32
 */
33
class AlphabeticalUseStatementsUnitTest extends AbstractMo4SniffUnitTest
34
{
35
    protected $expectedErrorList = [
36
        'AlphabeticalUseStatementsUnitTest.pass.inc'   => [],
37
        'AlphabeticalUseStatementsUnitTest.pass.1.inc' => [],
38
        'AlphabeticalUseStatementsUnitTest.fail.1.inc' =>
39
            [
40
                4  => 1,
41
                5  => 1,
42
                8  => 1,
43
                9  => 1,
44
                12 => 1,
45
            ],
46
        // Take care, more than one fix will be applied.
47
        'AlphabeticalUseStatementsUnitTest.fail.2.inc' =>
48
            [
49
                6 => 1,
50
                8 => 1,
51
            ],
52
        'AlphabeticalUseStatementsUnitTest.fail.3.inc' =>
53
            [
54
                7  => 1,
55
                8  => 1,
56
                10 => 1,
57
                15 => 1,
58
            ],
59
        'AlphabeticalUseStatementsUnitTest.fail.4.inc' =>
60
            [
61
                4  => 1,
62
                8  => 1,
63
                13 => 1,
64
                17 => 1,
65
                20 => 1,
66
                21 => 1,
67
            ],
68
        'AlphabeticalUseStatementsUnitTest.fail.6.inc' =>
69
            [5 => 1],
70
    ];
71
}
72