Completed
Push — master ( af28eb...bd6b4d )
by Shcherbak
03:04
created

LineBeforeClassEndFixerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B getLineBeforeClassEndDataProvider() 0 37 1
A testLineBeforeClassEnd() 0 7 1
1
<?php
2
3
  namespace Funivan\Cs\Tools\Php\LineBeforeClassEnd\Tests;
4
5
  use Funivan\Cs\Tools\Php\LineBeforeClassEnd\LineBeforeClassEndFixer;
6
  use Tests\Funivan\Cs\FixerTestCase;
7
8
  /**
9
   *
10
   */
11
  class LineBeforeClassEndFixerTest extends FixerTestCase {
12
13
    /**
14
     * @return array
15
     */
16
    public function getLineBeforeClassEndDataProvider() {
17
      return [
18
        [
19
          0,
20
          '<?php class A{
21
            cont T = 1;
22
23
          }',
24
          '<?php class A{
25
            cont T = 1;
26
          }',
27
        ],
28
        [
29
          0,
30
          '<?php class A{ cont T = 1; }',
31
          '<?php class A{ cont T = 1; }',
32
        ],
33
        [
34
          1,
35
          '<?php class A{
36
            cont T = 1;
37
          }',
38
          '<?php class A{
39
            cont T = 1;
40
41
          }',
42
        ],
43
        [
44
          2,
45
          '<?php class A{ cont T = 1;}',
46
          '<?php class A{ cont T = 1;
47
48
49
}',
50
        ],
51
      ];
52
    }
53
54
55
    /**
56
     * @dataProvider getLineBeforeClassEndDataProvider
57
     */
58
    public function testLineBeforeClassEnd($linesNum, $input, $expect) {
59
      $tool = new LineBeforeClassEndFixer();
60
      $tool->setLinesNum($linesNum);
61
62
63
      $this->process($tool, $input, $expect);
64
    }
65
66
  }
67