testLineBeforeClassEnd()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
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\BaseTestCase;
7
8
  /**
9
   *
10
   */
11
  class LineBeforeClassEndFixerTest extends BaseTestCase {
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
     * @param int $linesNum
58
     * @param string $input
59
     * @param string $expect
60
     */
61
    public function testLineBeforeClassEnd($linesNum, $input, $expect) {
62
      $tool = new LineBeforeClassEndFixer();
63
      $tool->setLinesNum($linesNum);
64
65
      self::assertFixer($tool, $input, $expect);
66
    }
67
68
  }
69