File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function compileDependencies($dependencies)
8282 $ code = $ name ;
8383 $ file = $ name ;
8484
85- if (preg_match ('/^[a-z0-9_-]+$/ ' , $ file )) {
85+ if (preg_match ('/^[a-z0-9_-]+$/i ' , $ file )) {
8686 $ file = __DIR__ . '/Helpers/ ' . ucfirst ($ name ) . '.h ' ;
8787 }
8888
Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ public function offsetUnset($name)
5151 }
5252}
5353
54+ class MagicGetterWithNoIsset
55+ {
56+ public function __get ($ name )
57+ {
58+ return $ name ;
59+ }
60+ }
61+
5462class DotHelperTest extends \PHPUnit_Framework_TestCase
5563{
5664 protected function getDotHelper ()
@@ -193,4 +201,18 @@ public function testCustomHelper()
193201 'a ' => 'x ' ,
194202 )));
195203 }
204+
205+ public function testDotObjectHelper ()
206+ {
207+ $ jsPhpize = new JsPhpize (array (
208+ 'helpers ' => array (
209+ 'dot ' => 'dotObject ' ,
210+ ),
211+ 'returnLastStatement ' => true ,
212+ ));
213+
214+ $ this ->assertEquals ('hello ' , $ jsPhpize ->render ('a.hello ' , array (
215+ 'a ' => new MagicGetterWithNoIsset (),
216+ )));
217+ }
196218}
You can’t perform that action at this time.
0 commit comments