Skip to content

Commit 16f5311

Browse files
committed
Fix runkit (and actually test the fix)
1 parent 7cac56f commit 16f5311

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PHPDraft/Core/BaseTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,21 @@ class BaseTest extends PHPUnit_Framework_TestCase
1919
const FUNCTION_ID = '_phpdraftbu';
2020
/**
2121
* Test Class
22+
*
2223
* @var mixed
2324
*/
2425
protected $class;
2526

2627
/**
2728
* Test reflection
29+
*
2830
* @var ReflectionClass
2931
*/
3032
protected $reflection;
3133

3234
/**
3335
* Clear up tests
36+
*
3437
* @return void
3538
*/
3639
public function tearDown()
@@ -76,7 +79,7 @@ private function __runkit_mock_function($name, $return)
7679
runkit_function_copy($name, $name . self::FUNCTION_ID);
7780
}
7881

79-
runkit_function_redefine($name, '', 'return '.(is_string($return)?'"'.$return.'"':$return).'";');
82+
runkit_function_redefine($name, '', 'return ' . (is_string($return) ? ('"' . $return . '"') : $return) . ';');
8083
}
8184

8285
/**
@@ -93,6 +96,7 @@ private function __uopz_mock_function($name, $return)
9396
\uopz_backup($name);
9497
\uopz_function($name, function () {
9598
global $return;
99+
96100
return $return;
97101
});
98102

0 commit comments

Comments
 (0)