We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97a7618 commit 4c5b8f8Copy full SHA for 4c5b8f8
tests/helpers.php
@@ -227,4 +227,25 @@ public function testHelperFile()
227
228
$this->assertEquals(6, $jsPhpize->render('13 + 7'));
229
}
230
+
231
+ public function testDotHelperWithArrayPrototype()
232
+ {
233
+ $jsPhpize = new JsPhpize(array(
234
+ 'helpers' => array(
235
+ 'dot' => 'dotWithArrayPrototype',
236
+ ),
237
+ 'returnLastStatement' => true,
238
+ ));
239
240
+ file_put_contents(
241
+ 'error.php',
242
+ "<?php\n".
243
+ $jsPhpize->compile('a = [1,2,3]; a.filter(function (i) { return i % 2; })')
244
+ );
245
+ exit;
246
+ $this->assertEquals(
247
+ array(1, 3),
248
+ $jsPhpize->render('a = [1,2,3]; a.filter(function (i) { return i % 2; })')
249
250
+ }
251
0 commit comments