Browse Source

Fix test for PHP 5.3 compatiblity

Marek Kalnik 11 năm trước cách đây
mục cha
commit
d0ec58bb14

+ 3 - 2
Tests/Controller/CRUDControllerTest.php

@@ -2341,8 +2341,9 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
         $args = func_get_args();
         $args = func_get_args();
 
 
         // creates equalTo of all arguments passed to this function
         // creates equalTo of all arguments passed to this function
-        $argsCheck = array_map(function($item) {
-            return $this->equalTo($item);
+        $phpunit = $this; // PHP 5.3 compatiblity
+        $argsCheck = array_map(function($item) use ($phpunit) {
+            return $phpunit->equalTo($item);
         }, func_get_args());
         }, func_get_args());
 
 
         $mock = $this->admin->expects($this->once())->method('trans');
         $mock = $this->admin->expects($this->once())->method('trans');