@@ -28,10 +28,11 @@ protected function setUp()
2828 public function attachFiles ()
2929 {
3030 $ paths = [
31+ static ::getSharedFixturesDirectory () . '/less ' => 1 ,
3132 static ::getSharedFixturesDirectory () . '/compass ' => 1 ,
32- static ::getSharedFixturesDirectory () . '/scss ' => 4 ,
3333 static ::getSharedFixturesDirectory () . '/scss/layout.scss ' => 1 ,
34- static ::getSharedFixturesDirectory () => 6
34+ static ::getSharedFixturesDirectory () . '/scss ' => 4 ,
35+ static ::getSharedFixturesDirectory () => 7
3536 ];
3637 foreach ($ paths as $ path => $ expectedFiles ) {
3738 $ processor = new Processor ($ this ->io );
@@ -61,6 +62,15 @@ public function processFileOnSCSS()
6162 $ this ->invokeProcessFileMethod ('scss/layout.scss ' , '' );
6263 }
6364
65+ /**
66+ * @see Processor::processFile
67+ * @test
68+ */
69+ public function processFileOnLESS ()
70+ {
71+ $ this ->invokeProcessFileMethod ('less/print.less ' , '' );
72+ }
73+
6474 /**
6575 * @see Processor::processFile
6676 * @test
@@ -114,7 +124,7 @@ public function processFileExpectedException()
114124 * @see Processor::getFormatterClass
115125 * @test
116126 */
117- public function getFormatterClass ()
127+ public function getFormatterClassOnCorrect ()
118128 {
119129 foreach (Processor::$ supportedFormatters as $ formatter ) {
120130 $ expected = 'Leafo \\ScssPhp \\Formatter \\' . ucfirst ($ formatter );
@@ -125,4 +135,38 @@ public function getFormatterClass()
125135 );
126136 }
127137 }
138+
139+ /**
140+ * @see Processor::getFormatterClass
141+ * @test
142+ *
143+ * @expectedException \InvalidArgumentException
144+ */
145+ public function getFormatterClassOnException ()
146+ {
147+ $ this ->invokeMethod (new Processor ($ this ->io ), 'getFormatterClass ' , ['not-existing ' ]);
148+ }
149+
150+ /**
151+ * @see Processor::fetchInputContextIntoFile
152+ * @test
153+ */
154+ public function fetchInputContextIntoFileOnSuccess ()
155+ {
156+ $ file = new FileContainer (static ::getSharedFixturesDirectory () . '/scss/layout.scss ' , '' );
157+ $ this ->invokeMethod (new Processor ($ this ->io ), 'fetchInputContextIntoFile ' , [$ file ]);
158+
159+ $ this ->assertNotNull ($ file ->getInputContent ());
160+ }
161+
162+ /**
163+ * @see Processor::fetchInputContextIntoFile
164+ * @test
165+ *
166+ * @expectedException \EM\CssCompiler\Exception\FileException
167+ */
168+ public function fetchInputContextIntoFileOnException ()
169+ {
170+ $ this ->invokeMethod (new Processor ($ this ->io ), 'fetchInputContextIntoFile ' , [new FileContainer ('input ' , 'output ' )]);
171+ }
128172}
0 commit comments