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

PhpSyntaxCheckReviewTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPhpFileSyntaxDataProvider() 0 17 1
A testPhpFileSyntax() 0 4 1
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