Completed
Push — master ( cd19a9...523c7b )
by Shcherbak
02:32
created

PhpFileStartLineReviewTest::testTestFileStart()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
  namespace Funivan\Cs\Tools\Php\FileStartLine;
4
5
6
  /**
7
   *
8
   */
9
  class PhpFileStartLineReviewTest extends \Tests\Funivan\Cs\ReviewTestCase {
10
11
    /**
12
     * @return array
13
     */
14
    public function getTestFileStartDataProvider() {
15
      return [
16
        [
17
          "<?php echo 1",
18
19
          [],
20
        ],
21
        [
22
          "
23
          
24
          <?php echo 1",
25
26
          [1],
27
        ],
28
        [
29
          "#!/usr/bin/env php",
30
          [],
31
        ],
32
        [
33
          "#!/usr/bin/php",
34
          [1],
35
        ],
36
      ];
37
    }
38
39
40
    /**
41
     * @dataProvider getTestFileStartDataProvider
42
     * @param string $input
43
     * @param array $expectErrorLines
44
     */
45
    public function testTestFileStart($input, array $expectErrorLines) {
46
      $report = $this->process(new PhpFileStartLineReview(), $input);
47
      $this->assertInvalidLinesInReport($report, $expectErrorLines);
48
    }
49
50
  }
51