Completed
Push — master ( 523c7b...71c525 )
by Shcherbak
02:31
created

PhpFileStartLineReviewTest   A

Complexity

Total Complexity 2

Size/Duplication

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getTestFileStartDataProvider() 0 24 1
A testTestFileStart() 0 4 1
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