Completed
Push — master ( bfc368...43106f )
by Shcherbak
02:26
created

LineAfterOpenTagReviewTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 50
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 50
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getLineAfterOpenTagDataProvider() 0 29 1
A testLineAfterOpenTag() 0 6 1
1
<?php
2
3
  namespace Funivan\Cs\Tools\Php\LineAfterOpenTag\Tests;
4
5
  use Funivan\Cs\Tools\Php\LineAfterOpenTag\LineAfterOpenTagReview;
6
  use Tests\Funivan\Cs\ReviewTestCase;
7
8
  /**
9
   *
10
   */
11
  class LineAfterOpenTagReviewTest extends ReviewTestCase {
12
13
    /**
14
     * @return array
15
     */
16
    public function getLineAfterOpenTagDataProvider() {
17
      return [
18
        [
19
          '<?php
20
21
22
23
',
24
          [1],
25
        ],
26
        [
27
          '<?php
28
29
echo 1;
30
',
31
          [],
32
        ],
33
        [
34
          '<?php
35
36
echo 1;?>
37
<?
38
39
40
',
41
          [4],
42
        ],
43
      ];
44
    }
45
46
47
    /**
48
     * @dataProvider getLineAfterOpenTagDataProvider
49
     * @param string $input
50
     * @param array $errorLines
51
     */
52
    public function testLineAfterOpenTag($input, array $errorLines) {
53
54
      $tool = new LineAfterOpenTagReview();
55
      $report = $this->process($tool, $input);
56
      $this->assertInvalidLinesInReport($report, $errorLines);
57
    }
58
59
60
  }
61