Completed
Push — master ( 7a83e2...2cf7e5 )
by Shcherbak
02:26
created

ReplaceSpacesInEmptyLinesFixerTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

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