Skip to content

Commit eb357e4

Browse files
committed
Don't use create_function() in tests
1 parent d9916ac commit eb357e4

8 files changed

+16
-16
lines changed

tests/PEAR_ErrorStack/test_global_context_createfunction.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', '$GLOBALS["stack"]->push(3);');
13+
$a = function() { $GLOBALS["stack"]->push(3); };
1414
$testline = __LINE__ - 1;
1515
$a();
1616

1717
$ret = $stack->pop();
1818
$phpunit->assertEquals(array('file' => __FILE__,
1919
'line' => $testline,
20-
'function' => 'create_function() code',
20+
'function' => '{closure}',
2121
), $ret['context'], 'context');
2222
echo 'tests done';
2323
?>

tests/PEAR_ErrorStack/test_global_context_createfunction_staticPush.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', 'PEAR_ErrorStack::staticPush("test", 3);');
13+
$a = function() { PEAR_ErrorStack::staticPush("test", 3); };
1414
$testline = __LINE__ - 1;
1515
$a();
1616

1717
$ret = $stack->pop();
1818
$phpunit->assertEquals(array('file' => __FILE__,
1919
'line' => $testline,
20-
'function' => 'create_function() code',
20+
'function' => '{closure}',
2121
), $ret['context'], 'context');
2222
echo 'tests done';
2323
?>

tests/PEAR_ErrorStack/test_infunction_context_createfunction.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', '$GLOBALS["stack"]->push(3);');
13+
$a = function() { $GLOBALS["stack"]->push(3); };
1414
$testline = __LINE__ - 1;
1515
function test7()
1616
{
@@ -22,7 +22,7 @@ test7();
2222
$ret = $stack->pop();
2323
$phpunit->assertEquals(array('file' => __FILE__,
2424
'line' => $testline,
25-
'function' => 'create_function() code',
25+
'function' => '{closure}',
2626
), $ret['context'], 'context');
2727
echo 'tests done';
2828
?>

tests/PEAR_ErrorStack/test_infunction_context_createfunction_staticPush.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', 'PEAR_ErrorStack::staticPush("test", 3);');
13+
$a = function() { PEAR_ErrorStack::staticPush("test", 3); };
1414
$testline = __LINE__ - 1;
1515
function test7()
1616
{
@@ -22,7 +22,7 @@ test7();
2222
$ret = $stack->pop();
2323
$phpunit->assertEquals(array('file' => __FILE__,
2424
'line' => $testline,
25-
'function' => 'create_function() code',
25+
'function' => '{closure}',
2626
), $ret['context'], 'context');
2727
echo 'tests done';
2828
?>

tests/PEAR_ErrorStack/test_inmethod_context_createfunction.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', '$GLOBALS["stack"]->push(3);');
13+
$a = function() { $GLOBALS["stack"]->push(3); };
1414
$testline = __LINE__ - 1;
1515
class test8
1616
{
@@ -26,7 +26,7 @@ $z->test7();
2626
$ret = $stack->pop();
2727
$phpunit->assertEquals(array('file' => __FILE__,
2828
'line' => $testline,
29-
'function' => 'create_function() code',
29+
'function' => '{closure}',
3030
), $ret['context'], 'context');
3131
echo 'tests done';
3232
?>

tests/PEAR_ErrorStack/test_inmethod_context_createfunction_staticPush.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', 'PEAR_ErrorStack::staticPush("test", 3);');
13+
$a = function() { PEAR_ErrorStack::staticPush("test", 3); };
1414
$testline = __LINE__ - 1;
1515
class test8
1616
{
@@ -26,7 +26,7 @@ $z->test7();
2626
$ret = $stack->pop();
2727
$phpunit->assertEquals(array('file' => __FILE__,
2828
'line' => $testline,
29-
'function' => 'create_function() code',
29+
'function' => '{closure}',
3030
), $ret['context'], 'context');
3131
echo 'tests done';
3232
?>

tests/PEAR_ErrorStack/test_instaticmethod_context_createfunction.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', '$GLOBALS["stack"]->push(3);');
13+
$a = function() { $GLOBALS["stack"]->push(3); };
1414
$testline = __LINE__ - 1;
1515
class test8
1616
{
@@ -25,7 +25,7 @@ test8::test7();
2525
$ret = $stack->pop();
2626
$phpunit->assertEquals(array('file' => __FILE__,
2727
'line' => $testline,
28-
'function' => 'create_function() code',
28+
'function' => '{closure}',
2929
), $ret['context'], 'context');
3030
echo 'tests done';
3131
?>

tests/PEAR_ErrorStack/test_instaticmethod_context_createfunction_staticPush.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!getenv('PHP_PEAR_RUNTESTS')) {
1010
<?php
1111
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
1212
$stack = &PEAR_ErrorStack::singleton('test');
13-
$a = create_function('', 'PEAR_ErrorStack::staticPush("test", 3);');
13+
$a = function() { PEAR_ErrorStack::staticPush("test", 3); };
1414
$testline = __LINE__ - 1;
1515
class test8
1616
{
@@ -25,7 +25,7 @@ test8::test7();
2525
$ret = $stack->pop();
2626
$phpunit->assertEquals(array('file' => __FILE__,
2727
'line' => $testline,
28-
'function' => 'create_function() code',
28+
'function' => '{closure}',
2929
), $ret['context'], 'context');
3030
echo 'tests done';
3131
?>

0 commit comments

Comments
 (0)