Completed
Push — master ( 8f7820...869ce5 )
by Pavel
02:09
created
tests/FileHandlerTest.php 1 patch
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -9,148 +9,148 @@
 block discarded – undo
9 9
 
10 10
 class FileHandlerTest extends \PHPUnit_Framework_TestCase {
11 11
 
12
-	/**
13
-	 * @var FileHandler
14
-	 */
15
-	private $fileHandler;
16
-
17
-	protected function setUp() {
18
-		parent::setUp();
19
-		$fs = new Filesystem();
20
-		$this->fileHandler = new FileHandler($fs, array('--env=prod'));
21
-	}
22
-
23
-	/**
24
-	 * @dataProvider preparePathProvider
25
-	 * @param $path
26
-	 * @param $expected
27
-	 */
28
-	public function testPreparePath($path, $expected) {
29
-		$this->assertEquals($expected, $this->fileHandler->preparePath($path));
30
-	}
31
-
32
-	public function preparePathProvider() {
33
-		return array(
34
-			'without env parameter' => array(
35
-				'path' => 'folder/parameters.yml',
36
-				'expected' => 'folder/parameters.yml'
37
-			),
38
-			'with env parameter' => array(
39
-				'path' => '{env}/parameters.yml',
40
-				'expected' => 'prod/parameters.yml'
41
-			),
42
-			'with different parameter' => array(
43
-				'path' => '{enev}/parameters.yml',
44
-				'expected' => '{enev}/parameters.yml'
45
-			)
46
-		);
47
-	}
48
-
49
-	/**
50
-	 * @param $name
51
-	 * @param $expected
52
-	 *
53
-	 * @dataProvider argumentValueProvider
54
-	 */
55
-	public function testArgumentValue($name, $expected) {
56
-		$this->assertEquals($expected, $this->fileHandler->getArgumentValue($name));
57
-	}
58
-
59
-	public function argumentValueProvider() {
60
-		return array(
61
-			'env found' => array(
62
-				'name' => 'env',
63
-				'expected' => 'prod',
64
-			),
65
-			'--env not found' => array(
66
-				'name' => '--env',
67
-				'expected' => false,
68
-			)
69
-		);
70
-	}
71
-
72
-
73
-	/**
74
-	 * @param $currentPath
75
-	 * @param $importPath
76
-	 * @param $expected
77
-	 * @dataProvider resolvePathProvider
78
-	 */
79
-	public function testResolvePath($currentPath, $importPath, $expected) {
80
-		$this->assertEquals($expected, $this->fileHandler->resolvePath($currentPath, $importPath));
81
-	}
82
-
83
-	public function resolvePathProvider() {
84
-		return array(
85
-			'parent path' => array(
86
-				'currentPath' => '/home/user/dir/current.yml',
87
-				'importPath' => '../import.yml',
88
-				'expected' => '/home/user/dir/../import.yml',
89
-			),
90
-			'current path' => array(
91
-				'currentPath' => '/home/user/dir/current.yml',
92
-				'importPath' => './import.yml',
93
-				'expected' => '/home/user/dir/./import.yml',
94
-			),
95
-
96
-			'current simple path' => array(
97
-				'currentPath' => '/home/user/dir/current.yml',
98
-				'importPath' => 'import.yml',
99
-				'expected' => '/home/user/dir/import.yml',
100
-			),
101
-			'absolute path' => array(
102
-				'currentPath' => '/home/user/dir/current.yml',
103
-				'importPath' => '/import.yml',
104
-				'expected' => '/import.yml',
105
-			)
106
-		);
107
-	}
108
-
109
-	public function testInitDirectory() {
110
-		vfsStreamWrapper::register();
111
-		vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
112
-
113
-		$buildDirName = 'createthis';
114
-		$buildDir = vfsStream::url('root/' . $buildDirName);
115
-
116
-		//currently doesn't exists
117
-		$this->assertFalse(vfsStreamWrapper::getRoot()->hasChild($buildDirName));
118
-
119
-		//create one
120
-		$this->fileHandler->initDirectory($buildDir);
121
-		$this->assertTrue(vfsStreamWrapper::getRoot()->hasChild($buildDirName));
122
-		vfsStreamWrapper::unregister();
123
-	}
124
-
125
-	/**
126
-	 * @param $expected
127
-	 * @param $value
128
-	 *
129
-	 * @dataProvider testProcessEnvironmentalVariableProvider
130
-	 */
131
-	public function testProcessEnvironmentalVariable($value, $expected) {
132
-		$this->assertEquals($expected, $this->fileHandler->processEnvironmentalVariable($value));
133
-	}
134
-
135
-	public function testProcessEnvironmentalVariableProvider() {
136
-		return array(
137
-			'string' => array(
138
-				'value' => 'string',
139
-				'expected' => 'string'
140
-			),
141
-			'number' => array(
142
-				'value' => 444,
143
-				'expected' => 444
144
-			),
145
-			'env variable' => array(
146
-				'value' => '%env(PATH)%',
147
-				'expected' => getenv('PATH')
148
-			),
149
-
150
-			'string like env' => array(
151
-				'value' => 'env(PATH)%',
152
-				'expected' => 'env(PATH)%'
153
-			)
154
-		);
155
-	}
12
+    /**
13
+     * @var FileHandler
14
+     */
15
+    private $fileHandler;
16
+
17
+    protected function setUp() {
18
+        parent::setUp();
19
+        $fs = new Filesystem();
20
+        $this->fileHandler = new FileHandler($fs, array('--env=prod'));
21
+    }
22
+
23
+    /**
24
+     * @dataProvider preparePathProvider
25
+     * @param $path
26
+     * @param $expected
27
+     */
28
+    public function testPreparePath($path, $expected) {
29
+        $this->assertEquals($expected, $this->fileHandler->preparePath($path));
30
+    }
31
+
32
+    public function preparePathProvider() {
33
+        return array(
34
+            'without env parameter' => array(
35
+                'path' => 'folder/parameters.yml',
36
+                'expected' => 'folder/parameters.yml'
37
+            ),
38
+            'with env parameter' => array(
39
+                'path' => '{env}/parameters.yml',
40
+                'expected' => 'prod/parameters.yml'
41
+            ),
42
+            'with different parameter' => array(
43
+                'path' => '{enev}/parameters.yml',
44
+                'expected' => '{enev}/parameters.yml'
45
+            )
46
+        );
47
+    }
48
+
49
+    /**
50
+     * @param $name
51
+     * @param $expected
52
+     *
53
+     * @dataProvider argumentValueProvider
54
+     */
55
+    public function testArgumentValue($name, $expected) {
56
+        $this->assertEquals($expected, $this->fileHandler->getArgumentValue($name));
57
+    }
58
+
59
+    public function argumentValueProvider() {
60
+        return array(
61
+            'env found' => array(
62
+                'name' => 'env',
63
+                'expected' => 'prod',
64
+            ),
65
+            '--env not found' => array(
66
+                'name' => '--env',
67
+                'expected' => false,
68
+            )
69
+        );
70
+    }
71
+
72
+
73
+    /**
74
+     * @param $currentPath
75
+     * @param $importPath
76
+     * @param $expected
77
+     * @dataProvider resolvePathProvider
78
+     */
79
+    public function testResolvePath($currentPath, $importPath, $expected) {
80
+        $this->assertEquals($expected, $this->fileHandler->resolvePath($currentPath, $importPath));
81
+    }
82
+
83
+    public function resolvePathProvider() {
84
+        return array(
85
+            'parent path' => array(
86
+                'currentPath' => '/home/user/dir/current.yml',
87
+                'importPath' => '../import.yml',
88
+                'expected' => '/home/user/dir/../import.yml',
89
+            ),
90
+            'current path' => array(
91
+                'currentPath' => '/home/user/dir/current.yml',
92
+                'importPath' => './import.yml',
93
+                'expected' => '/home/user/dir/./import.yml',
94
+            ),
95
+
96
+            'current simple path' => array(
97
+                'currentPath' => '/home/user/dir/current.yml',
98
+                'importPath' => 'import.yml',
99
+                'expected' => '/home/user/dir/import.yml',
100
+            ),
101
+            'absolute path' => array(
102
+                'currentPath' => '/home/user/dir/current.yml',
103
+                'importPath' => '/import.yml',
104
+                'expected' => '/import.yml',
105
+            )
106
+        );
107
+    }
108
+
109
+    public function testInitDirectory() {
110
+        vfsStreamWrapper::register();
111
+        vfsStreamWrapper::setRoot(new vfsStreamDirectory('root'));
112
+
113
+        $buildDirName = 'createthis';
114
+        $buildDir = vfsStream::url('root/' . $buildDirName);
115
+
116
+        //currently doesn't exists
117
+        $this->assertFalse(vfsStreamWrapper::getRoot()->hasChild($buildDirName));
118
+
119
+        //create one
120
+        $this->fileHandler->initDirectory($buildDir);
121
+        $this->assertTrue(vfsStreamWrapper::getRoot()->hasChild($buildDirName));
122
+        vfsStreamWrapper::unregister();
123
+    }
124
+
125
+    /**
126
+     * @param $expected
127
+     * @param $value
128
+     *
129
+     * @dataProvider testProcessEnvironmentalVariableProvider
130
+     */
131
+    public function testProcessEnvironmentalVariable($value, $expected) {
132
+        $this->assertEquals($expected, $this->fileHandler->processEnvironmentalVariable($value));
133
+    }
134
+
135
+    public function testProcessEnvironmentalVariableProvider() {
136
+        return array(
137
+            'string' => array(
138
+                'value' => 'string',
139
+                'expected' => 'string'
140
+            ),
141
+            'number' => array(
142
+                'value' => 444,
143
+                'expected' => 444
144
+            ),
145
+            'env variable' => array(
146
+                'value' => '%env(PATH)%',
147
+                'expected' => getenv('PATH')
148
+            ),
149
+
150
+            'string like env' => array(
151
+                'value' => 'env(PATH)%',
152
+                'expected' => 'env(PATH)%'
153
+            )
154
+        );
155
+    }
156 156
 }
Please login to merge, or discard this patch.
src/Adapter/Output/OutputAdapterInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@
 block discarded – undo
8 8
      */
9 9
     public static function getName();
10 10
 
11
-	/**
12
-	 * @param $parameters
13
-	 * @param $fileName
14
-	 * @param $env
15
-	 * @param null|int $date
16
-	 * @return
17
-	 */
11
+    /**
12
+     * @param $parameters
13
+     * @param $fileName
14
+     * @param $env
15
+     * @param null|int $date
16
+     * @return
17
+     */
18 18
     public function process($parameters, $fileName, $env, $date);
19 19
 }
20 20
\ No newline at end of file
Please login to merge, or discard this patch.