Completed
Push — master ( 523c7b...71c525 )
by Shcherbak
02:31
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\Tests;
4
5
  use Funivan\Cs\Tools\Php\FileStartLine\PhpFileStartLineReview;
6
7
  /**
8
   *
9
   */
10
  class PhpFileStartLineReviewTest extends \Tests\Funivan\Cs\ReviewTestCase {
11
12
    /**
13
     * @return array
14
     */
15
    public function getTestFileStartDataProvider() {
16
      return [
17
        [
18
          '<?php echo 1',
19
20
          [],
21
        ],
22
        [
23
          '
24
          
25
          <?php echo 1',
26
27
          [1],
28
        ],
29
        [
30
          '#!/usr/bin/env php',
31
          [],
32
        ],
33
        [
34
          '#!/usr/bin/php',
35
          [1],
36
        ],
37
      ];
38
    }
39
40
41
    /**
42
     * @dataProvider getTestFileStartDataProvider
43
     * @param string $input
44
     * @param array $expectErrorLines
45
     */
46
    public function testTestFileStart($input, array $expectErrorLines) {
47
      $report = $this->process(new PhpFileStartLineReview(), $input);
48
      $this->assertInvalidLinesInReport($report, $expectErrorLines);
49
    }
50
51
  }
52