File tree 4 files changed +36
-2
lines changed
4 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -66,4 +66,14 @@ public function testSetNodeValue()
66
66
67
67
self ::assertSame ("'after' " , $ fakeNode ->getBarValue ());
68
68
}
69
+
70
+ public function testPathForWrongNode ()
71
+ {
72
+ require_once __DIR__ . '/Fixture/FakeNode.php ' ;
73
+ require_once __DIR__ . '/Fixture/BlockExtractorTester.php ' ;
74
+
75
+ $ extractor = new BlockExtractorTester ((object ) array ());
76
+
77
+ self ::assertNull ($ extractor ->getPathForWrongNode ());
78
+ }
69
79
}
Original file line number Diff line number Diff line change @@ -24,4 +24,9 @@ public function changeValue($node)
24
24
{
25
25
$ this ->setNodeValue ($ node , 'bar ' , 'after ' );
26
26
}
27
+
28
+ public function getPathForWrongNode ()
29
+ {
30
+ return $ this ->getNodePath (new \stdClass ());
31
+ }
27
32
}
Original file line number Diff line number Diff line change @@ -187,7 +187,11 @@ public function testProductionWithMinify()
187
187
$ this ->cleanTempDir ();
188
188
}
189
189
190
- public function testProductionWithConcat ()
190
+ /**
191
+ * @testWith ["test-concat"]
192
+ * ["relative/test-root"]
193
+ */
194
+ public function testProductionWithConcat ($ path )
191
195
{
192
196
$ this ->cleanTempDir ();
193
197
$ outputDirectory = $ this ->getTempDir ();
@@ -201,7 +205,7 @@ public function testProductionWithConcat()
201
205
));
202
206
$ minify = new Minify ($ pug );
203
207
$ pug ->addKeyword ('concat ' , $ minify );
204
- $ html = static ::simpleHtml ($ this ->renderFile ($ pug , __DIR__ . '/test-concat .pug ' ));
208
+ $ html = static ::simpleHtml ($ this ->renderFile ($ pug , __DIR__ . '/ ' . $ path . ' .pug ' ));
205
209
$ expected = static ::simpleHtml (file_get_contents (__DIR__ . '/prod-concat.html ' ));
206
210
207
211
self ::assertSimilar ($ expected , $ html );
Original file line number Diff line number Diff line change
1
+ doctype 5
2
+ html
3
+ head
4
+ title Foo
5
+ concat top
6
+ script( src ="coffee/test.coffee" )
7
+ script( src ="react-pug/test.jsxp" type ="text/babel" )
8
+ link( rel ="stylesheet" href ="less/test.less" )
9
+ link( rel ="stylesheet" href ="stylus/test.styl" )
10
+ body
11
+ h1 Foobar
12
+ concat bottom
13
+ script( src ="react/test.jsx" type ="text/babel" )
14
+ script( src ="coffee-pug/test.cofp" )
15
+ concat empty
You can’t perform that action at this time.
0 commit comments