Completed
Push — master ( 8ca4cf...cd19a9 )
by Shcherbak
03:05
created

PhpSyntaxCheckReviewTest::testPhpFileSyntax()   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\SyntaxCheck\Tests;
4
5
  use Funivan\Cs\Tools\Php\SyntaxCheck\PhpSyntaxCheckReview;
6
  use Tests\Funivan\Cs\ReviewTestCase;
7
8
  /**
9
   *
10
   */
11
  class PhpSyntaxCheckReviewTest extends ReviewTestCase {
12
13
    /**
14
     * @return array
15
     */
16
    public function getPhpFileSyntaxDataProvider() {
17
      return [
18
        [
19
          "<?php echo 1;",
20
          [],
21
        ],
22
        [
23
          "<?php decho 1;",
24
          [1],
25
        ],
26
        [
27
          "<?php 
28
          decho 1;",
29
          [2],
30
        ],
31
      ];
32
    }
33
34
35
    /**
36
     * @dataProvider getPhpFileSyntaxDataProvider
37
     * @param string $input
38
     * @param array $expectErrorLines
39
     */
40
    public function testPhpFileSyntax($input, array $expectErrorLines) {
41
      $report = $this->process(new PhpSyntaxCheckReview(), $input);
42
      $this->assertInvalidLinesInReport($report, $expectErrorLines);
43
    }
44
45
  }
46