Commit b2ca7d22 authored by Simon Welsh's avatar Simon Welsh

Support safe_pass_by_ref

Fixes #22
parent 1193b762
Pipeline #204 failed with stages
in 1 minute and 45 seconds
...@@ -5,6 +5,7 @@ stages: ...@@ -5,6 +5,7 @@ stages:
before_script: before_script:
- "echo 'assume_php=false' > .hhconfig" - "echo 'assume_php=false' > .hhconfig"
- echo 'enable_experimental_tc_features = safe_pass_by_ref' >> .hhconfig
- ./tests/composer.sh - ./tests/composer.sh
- composer install - composer install
......
...@@ -7,7 +7,7 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase { ...@@ -7,7 +7,7 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase {
$file = __DIR__.'/runs/'.$testName.'.hhit'; $file = __DIR__.'/runs/'.$testName.'.hhit';
$parts = explode('---', file_get_contents($file)); $parts = explode('---', file_get_contents($file));
$head = array_shift($parts); $head = array_shift(&$parts);
$this->assertEmpty( $this->assertEmpty(
$head, $head,
'File for test '.$testName.' has invalid start', 'File for test '.$testName.' has invalid start',
...@@ -42,7 +42,7 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase { ...@@ -42,7 +42,7 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase {
$ret = null; $ret = null;
$output_arr = null; $output_arr = null;
$output = \exec($cmd, $output_arr, $ret); $output = \exec($cmd, &$output_arr, &$ret);
$json = @\json_decode($output, true); $json = @\json_decode($output, true);
...@@ -85,8 +85,8 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase { ...@@ -85,8 +85,8 @@ abstract class HHITest extends \PHPUnit_Framework_TestCase {
return strcmp($err1['error'], $err2['error']); return strcmp($err1['error'], $err2['error']);
}; };
usort($actualErrors, $sorter); usort(&$actualErrors, $sorter);
usort($expectedErrors, $sorter); usort(&$expectedErrors, $sorter);
$this->assertEquals($expectedErrors, $actualErrors); $this->assertEquals($expectedErrors, $actualErrors);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment