dev/core#130 Remove deprecated create_function from RegionTest in favor of an annoymo...
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 19 May 2018 04:04:25 +0000 (14:04 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sat, 19 May 2018 04:04:25 +0000 (14:04 +1000)
tests/phpunit/CRM/Core/RegionTest.php

index 121129862f6ca2855f7413c0ad31df243fb3afc3..3f4956eba1345ef3fa65bcea647f68e608237725 100644 (file)
@@ -73,11 +73,15 @@ class CRM_Core_RegionTest extends CiviUnitTestCase {
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns a value which gets appended to the region
-      'callback' => create_function('&$spec, &$html', 'return "callback-return<br/>";'),
+      'callback' => function(&$spec, &$html) {
+         return "callback-return<br/>";
+      },
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       // note: returns void; directly modifies region's $html
-      'callback' => create_function('&$spec, &$html', '$html = "callback-ref<br/>" . $html;'),
+      'callback' => function(&$spec, &$html) {
+        $html = "callback-ref<br/>" . $html;
+      },
     ));
     CRM_Core_Region::instance('testAllTypes')->add(array(
       'scriptUrl' => '/foo%20bar.js',