From 9bcbd47da7019031206b67ee86623279129b7748 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 13:43:35 +0200 Subject: [PATCH 01/22] No longer run HHVM tests --- .travis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d217ed43e..8fa1b4100c 100755 --- a/.travis.yml +++ b/.travis.yml @@ -7,13 +7,6 @@ php: - 7.1 - 7.2 - nightly - - hhvm - - hhvm-nightly - -matrix: - allow_failures: - - php: hhvm - - php: hhvm-nightly before_script: - if [[ $TRAVIS_PHP_VERSION = "hhvm"* ]]; then echo hhvm.hack_compiler_default=false > /etc/hhvm/php.ini; fi From 12858fed0067133a100883f351f8dacba86741ed Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 13:43:44 +0200 Subject: [PATCH 02/22] Remove HHVM badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 3391620031..2d4587c069 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ XP Framework Core [![Build status on AppVeyor](https://ci.appveyor.com/api/projects/status/bb9gkkq1o7f6m2ns?svg=true)](https://ci.appveyor.com/project/thekid/core) [![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md) [![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.png)](http://php.net/) -[![Supports HHVM 3.20+](https://raw.githubusercontent.com/xp-framework/web/master/static/hhvm-3_20plus.png)](http://hhvm.com/) [![Latest Stable Version](https://poser.pugx.org/xp-framework/core/version.png)](https://packagist.org/packages/xp-framework/core) This is the XP Framework's development checkout. From 3665a84ae0eeddbacbf584be114eef8e11fc4d9e Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 13:45:23 +0200 Subject: [PATCH 03/22] Remove check on HHVM_VERSION_ID & hhvm.php7.all --- src/main/php/__xp.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/php/__xp.php b/src/main/php/__xp.php index 3ef136185a..e0dfafe79e 100755 --- a/src/main/php/__xp.php +++ b/src/main/php/__xp.php @@ -3,13 +3,6 @@ if (PHP_VERSION_ID < 70000) { throw new \Exception('This version of the XP Framework requires PHP 7.0.0+, have PHP '.PHP_VERSION); } -if (defined('HHVM_VERSION_ID')) { - if (HHVM_VERSION_ID < 32000) { - throw new \Exception('This version of the XP Framework requires HHVM 3.20+, have HHVM '.HHVM_VERSION); - } else if (!ini_get('hhvm.php7.all')) { - throw new \Exception('This version of the XP Framework requires hhvm.php7.all to be set to 1'); - } -} $p= max(strrpos(__FILE__, DIRECTORY_SEPARATOR), strrpos(__FILE__, '?')); require_once substr(__FILE__, 0, $p + 1).'lang.base.php'; From 5ad27f3ba96f799283c4d20f207f86390cefe864 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 13:46:25 +0200 Subject: [PATCH 04/22] Remove HHVM-specific condition on missing argument error --- src/main/php/lang.base.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/php/lang.base.php b/src/main/php/lang.base.php index ac83ec8eec..e9e58f72a1 100755 --- a/src/main/php/lang.base.php +++ b/src/main/php/lang.base.php @@ -130,10 +130,7 @@ function __error($code, $msg, $file, $line) { } } else if (0 === strncmp($msg, 'Undefined variable', 18)) { throw new \lang\NullPointerException($msg); - } else if (0 === strncmp($msg, 'Missing argument', 16) || ( - defined('HHVM_VERSION') && - 3 === sscanf($msg, '%*s() expects exactly %*d parameter, %*d given') - )) { + } else if (0 === strncmp($msg, 'Missing argument', 16)) { throw new \lang\IllegalArgumentException($msg); } else if (( 0 === strncmp($msg, 'Undefined offset', 16) || From b93f4b1ede1c9f17299dd15b3d8bbde3fb34df54 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 13:47:22 +0200 Subject: [PATCH 05/22] Remove workaround for HHVM not supporting typehints w/ variadics --- src/main/php/lang/ClassLoader.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/lang/ClassLoader.class.php b/src/main/php/lang/ClassLoader.class.php index 5707aba3f8..b532f0d449 100755 --- a/src/main/php/lang/ClassLoader.class.php +++ b/src/main/php/lang/ClassLoader.class.php @@ -229,7 +229,7 @@ protected static function defineForward($name, $func, $invoke) { } if ($param->isVariadic()) { - $sig.= defined('HHVM_VERSION') ? ', ... $'.$p : ', '.$constraint.'... $'.$p; + $sig.= ', '.$constraint.'... $'.$p; $pass.= ', ...$'.$p; } else { $sig.= ', '.$constraint.' $'.$p; From 138bff4243157cffc5385f3ffe3475003c681fd7 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:23:58 +0200 Subject: [PATCH 06/22] Remove workaround for HHVM reflection API vagaries --- src/main/php/lang/reflect/Field.class.php | 35 +++-------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/src/main/php/lang/reflect/Field.class.php b/src/main/php/lang/reflect/Field.class.php index c65389ead2..0bbc3eff6c 100755 --- a/src/main/php/lang/reflect/Field.class.php +++ b/src/main/php/lang/reflect/Field.class.php @@ -18,39 +18,10 @@ * @see xp://lang.XPClass */ class Field implements Value { - private static $read, $write; protected $accessible= false; protected $_class= null; public $_reflect= null; - static function __static() { - if (defined('HHVM_VERSION_ID')) { - self::$read= function($class, $reflect, $instance, $public) { - if (null === $instance) { - return hphp_get_static_property($class, $reflect->name, !$public); - } else { - return hphp_get_property($instance, $class, $reflect->name); - } - }; - self::$write= function($class, $reflect, $instance, $value, $public) { - if (null === $instance) { - return hphp_set_static_property($class, $reflect->name, $value, !$public); - } else { - return hphp_set_property($instance, $class, $reflect->name, $value); - } - }; - } else { - self::$read= function($class, $reflect, $instance, $public) { - $public || $reflect->setAccessible(true); - return $reflect->getValue($instance); - }; - self::$write= function($class, $reflect, $instance, $value, $public) { - $public || $reflect->setAccessible(true); - return $reflect->setValue($instance, $value); - }; - } - } - /** * Constructor * @@ -210,7 +181,8 @@ public function get($instance) { } try { - return (self::$read)($this->_class, $this->_reflect, $instance, $public); + $public || $this->_reflect->setAccessible(true); + return $this->_reflect->getValue($instance); } catch (Throwable $e) { throw $e; } catch (\Throwable $e) { @@ -262,7 +234,8 @@ public function set($instance, $value) { } try { - return (self::$write)($this->_class, $this->_reflect, $instance, $value, $public); + $public || $this->_reflect->setAccessible(true); + return $this->_reflect->setValue($instance, $value); } catch (Throwable $e) { throw $e; } catch (\Throwable $e) { From 5f426bf74f41a364a3d01ac14e82d67b4ddefb69 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:24:44 +0200 Subject: [PATCH 07/22] Remove ReflectionField::getTypeText() HHVM specific calls --- src/main/php/lang/reflect/Field.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/php/lang/reflect/Field.class.php b/src/main/php/lang/reflect/Field.class.php index 0bbc3eff6c..eaf4845de0 100755 --- a/src/main/php/lang/reflect/Field.class.php +++ b/src/main/php/lang/reflect/Field.class.php @@ -43,8 +43,6 @@ public function getType(): Type { $type= $details[DETAIL_RETURNS]; } else if (isset($details[DETAIL_ANNOTATIONS]['type'])) { $type= $details[DETAIL_ANNOTATIONS]['type']; - } else if (defined('HHVM_VERSION')) { - $type= $this->_reflect->getTypeText() ?: 'var'; } else { return Type::$VAR; } @@ -65,8 +63,6 @@ public function getTypeName(): string { return $details[DETAIL_RETURNS]; } else if (isset($details[DETAIL_ANNOTATIONS]['type'])) { return $details[DETAIL_ANNOTATIONS]['type']; - } else if (defined('HHVM_VERSION')) { - return str_replace('HH\\', '', $this->_reflect->getTypeText()) ?: 'var'; } } return 'var'; From f3418790bc222974373601ad5b729d9dddde2903 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:25:32 +0200 Subject: [PATCH 08/22] Remove "HH"-namespaced type aliases --- src/main/php/lang/Type.class.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/php/lang/Type.class.php b/src/main/php/lang/Type.class.php index 34911e815a..864356d962 100755 --- a/src/main/php/lang/Type.class.php +++ b/src/main/php/lang/Type.class.php @@ -203,10 +203,6 @@ public static function forName($type) { 'float' => 'float', 'bool' => 'bool', 'boolean' => 'bool', - 'HH\int' => 'int', - 'HH\string' => 'string', - 'HH\float' => 'float', - 'HH\bool' => 'bool' ]; $l= strlen($type); @@ -217,9 +213,9 @@ public static function forName($type) { // Map well-known primitives, var, void, union types as well as nullable and soft types if (isset($primitives[$type])) { return Primitive::forName($primitives[$type]); - } else if ('var' === $type || 'resource' === $type || 'HH\mixed' === $type) { + } else if ('var' === $type || 'resource' === $type) { return self::$VAR; - } else if ('void' === $type || 'HH\void' === $type || 'HH\noreturn' === $type) { + } else if ('void' === $type) { return self::$VOID; } else if ('array' === $type) { return self::$ARRAY; From 2e1489ace9267034036e49306e8a49cb46c39e87 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:27:26 +0200 Subject: [PATCH 09/22] Remove HHVM-specific handling of variadics, which slightly differed from PHP --- src/main/php/lang/reflect/Parameter.class.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/php/lang/reflect/Parameter.class.php b/src/main/php/lang/reflect/Parameter.class.php index bcd465f47d..fb51d7e62c 100755 --- a/src/main/php/lang/reflect/Parameter.class.php +++ b/src/main/php/lang/reflect/Parameter.class.php @@ -59,12 +59,6 @@ public function getType() { !isset($details[DETAIL_ARGUMENTS][$this->_details[2]]) ) { - // ReflectionParameter::getType() *always* returns "array" on HHVM, this is - // a) useless and b) inconsistent with PHP. Fall back to "var" - if (defined('HHVM_VERSION') && $this->_reflect->isVariadic()) { - return Type::$VAR; - } - // Cannot parse api doc, fall back to PHP native syntax. The reason for not doing // this the other way around is that we have "richer" information, e.g. "string[]", // where PHP simply knows about "arrays" (of whatever). @@ -96,14 +90,8 @@ public function getTypeName() { return ltrim($details[DETAIL_ARGUMENTS][$this->_details[2]], '&'); } - // ReflectionParameter::getType() *always* returns "array" on HHVM, this is - // a) useless and b) inconsistent with PHP. Fall back to "var" - if (defined('HHVM_VERSION') && $this->_reflect->isVariadic()) { - return 'var'; - } - if ($t= $this->_reflect->getType()) { - return str_replace('HH\\', '', $t); + return $t; } else { return 'var'; } @@ -143,7 +131,7 @@ public function getTypeRestriction() { * @return bool */ public function isOptional() { - return $this->_reflect->isOptional() || (defined('HHVM_VERSION') && $this->_reflect->isVariadic()); + return $this->_reflect->isOptional(); } /** @@ -172,7 +160,7 @@ public function isVariadic() { * @return var */ public function getDefaultValue() { - if ($this->_reflect->isOptional() || (defined('HHVM_VERSION') && $this->_reflect->isVariadic())) { + if ($this->_reflect->isOptional()) { return $this->_reflect->isDefaultValueAvailable() ? $this->_reflect->getDefaultValue() : null; } From 83ef01c5c003619567cb2f9a9671902a7ccb2c8c Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:28:44 +0200 Subject: [PATCH 10/22] Remove ReflectionMethod::getReturnTypeText() HHVM specific calls --- src/main/php/lang/reflect/Routine.class.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main/php/lang/reflect/Routine.class.php b/src/main/php/lang/reflect/Routine.class.php index b3d9fce33c..0d9485dee0 100755 --- a/src/main/php/lang/reflect/Routine.class.php +++ b/src/main/php/lang/reflect/Routine.class.php @@ -113,15 +113,6 @@ public function getReturnType(): Type { } else { return Type::forName($t); } - } else if (defined('HHVM_VERSION')) { - $t= $this->_reflect->getReturnTypeText() ?: 'var'; - if ('self' === $t) { - return new XPClass($this->_reflect->getDeclaringClass()); - } else if ('HH\\this' === $t) { - return new XPClass($this->_class); - } else { - return Type::forName($t); - } } else if ($t= $this->_reflect->getReturnType()) { return Type::forName((string)$t); } else { @@ -137,9 +128,7 @@ public function getReturnTypeName(): string { ) { return ltrim($details[DETAIL_RETURNS], '&'); } else if ($t= $this->_reflect->getReturnType()) { - return str_replace('HH\\', '', $t); - } else if (defined('HHVM_VERSION')) { - return str_replace('HH\\', '', $this->_reflect->getReturnTypeText() ?: 'var'); + return $t; } else { return 'var'; } From 73a6d5e70003a7bdf922ebe5f7211bcdbc0dc081 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:29:32 +0200 Subject: [PATCH 11/22] Remove HHVM-conditional "--php" command line arg --- src/main/php/lang/RuntimeOptions.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/lang/RuntimeOptions.class.php b/src/main/php/lang/RuntimeOptions.class.php index 148f27c457..5025a84b9f 100755 --- a/src/main/php/lang/RuntimeOptions.class.php +++ b/src/main/php/lang/RuntimeOptions.class.php @@ -108,7 +108,7 @@ public function getClassPath() { * @return string[] */ public function asArguments() { - $s= defined('HHVM_VERSION') ? ['--php'] : []; + $s= []; foreach ($this->backing as $key => $value) { if ("\1" === $key{0}) { $s[]= '-'.substr($key, 1); From 12eb61407e0258a223a7124c684b284bf3916e5b Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:31:14 +0200 Subject: [PATCH 12/22] Remove HHVM-specific public ReflectionProperty fields access --- src/main/php/lang/XPClass.class.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/main/php/lang/XPClass.class.php b/src/main/php/lang/XPClass.class.php index 72c9adbc48..3473ec2941 100755 --- a/src/main/php/lang/XPClass.class.php +++ b/src/main/php/lang/XPClass.class.php @@ -302,17 +302,10 @@ public function getFields() { */ public function getDeclaredFields() { $list= []; - $reflect= $this->reflect(); - if (defined('HHVM_VERSION')) { - foreach ($reflect->getProperties() as $p) { - if ('__id' === $p->name || $p->info['class'] !== $reflect->name) continue; - $list[]= new Field($this->_class, $p); - } - } else { - foreach ($reflect->getProperties() as $p) { - if ('__id' === $p->name || $p->class !== $reflect->name) continue; - $list[]= new Field($this->_class, $p); - } + $reflect= $this->reflect()->name; + foreach ($reflect->getProperties() as $p) { + if ('__id' === $p->name || $p->class !== $reflect) continue; + $list[]= new Field($this->_class, $p); } return $list; } From 0a8a266f68027a93670b54babe55453ba96b7fce Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:32:00 +0200 Subject: [PATCH 13/22] Remove HHVM engine version computation --- src/main/php/xp/runtime/Version.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/php/xp/runtime/Version.class.php b/src/main/php/xp/runtime/Version.class.php index eed188313a..174f904f2b 100755 --- a/src/main/php/xp/runtime/Version.class.php +++ b/src/main/php/xp/runtime/Version.class.php @@ -1,7 +1,7 @@ Date: Sat, 29 Sep 2018 14:32:44 +0200 Subject: [PATCH 14/22] Remove HHVM version from documentation --- src/main/resources/xp/runtime/version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/xp/runtime/version.md b/src/main/resources/xp/runtime/version.md index 317cdf8d4f..2f7bccc7b7 100755 --- a/src/main/resources/xp/runtime/version.md +++ b/src/main/resources/xp/runtime/version.md @@ -16,7 +16,7 @@ ```sh $ xp version php ``` -* Display Engine version - HHVM or Zend +* Display Zend Engine version ```sh $ xp version engine ``` From b67dbbd1264b8aab9329fe170c0ab7466e2c0fab Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:33:11 +0200 Subject: [PATCH 15/22] Remove support for hack language --- src/test/config/unittest/core.ini | 3 - .../reflection/HackLanguageEnum.class.php | 8 - .../reflection/HackLanguageSupport.class.php | 21 -- .../HackLanguageSupportTest.class.php | 181 ------------------ 4 files changed, 213 deletions(-) delete mode 100644 src/test/php/net/xp_framework/unittest/reflection/HackLanguageEnum.class.php delete mode 100644 src/test/php/net/xp_framework/unittest/reflection/HackLanguageSupport.class.php delete mode 100644 src/test/php/net/xp_framework/unittest/reflection/HackLanguageSupportTest.class.php diff --git a/src/test/config/unittest/core.ini b/src/test/config/unittest/core.ini index cd5bba258f..e3cc4954ff 100644 --- a/src/test/config/unittest/core.ini +++ b/src/test/config/unittest/core.ini @@ -264,8 +264,5 @@ class="net.xp_framework.unittest.runtime.CodeTest" [markdown-rendering] class="net.xp_framework.unittest.runtime.RenderMarkdownTest" -[hhvm:hack] -class="net.xp_framework.unittest.reflection.HackLanguageSupportTest" - [environment] class="net.xp_framework.unittest.core.EnvironmentTest" diff --git a/src/test/php/net/xp_framework/unittest/reflection/HackLanguageEnum.class.php b/src/test/php/net/xp_framework/unittest/reflection/HackLanguageEnum.class.php deleted file mode 100644 index 5b0a5967da..0000000000 --- a/src/test/php/net/xp_framework/unittest/reflection/HackLanguageEnum.class.php +++ /dev/null @@ -1,8 +0,0 @@ -assertEquals(Type::$VAR, Type::forName('HH\mixed')); - } - - #[@test] - public function string_type() { - $this->assertEquals(Primitive::$STRING, Type::forName('HH\string')); - } - - #[@test] - public function int_type() { - $this->assertEquals(Primitive::$INT, Type::forName('HH\int')); - } - - #[@test] - public function double_type() { - $this->assertEquals(Primitive::$FLOAT, Type::forName('HH\float')); - } - - #[@test] - public function bool_type() { - $this->assertEquals(Primitive::$BOOL, Type::forName('HH\bool')); - } - - #[@test] - public function array_of_string_type() { - $this->assertEquals(new ArrayType('string'), Type::forName('array')); - } - - #[@test] - public function map_of_int_type() { - $this->assertEquals(new MapType('int'), Type::forName('array')); - } - - #[@test] - public function nullable_type() { - $this->assertEquals(XPClass::forName('lang.Value'), Type::forName('?lang\Value')); - } - - #[@test] - public function method_string_return_type() { - $this->assertEquals(Primitive::$STRING, $this->testClass()->getMethod('returnsString')->getReturnType()); - } - - #[@test] - public function method_string_return_type_name() { - $this->assertEquals('string', $this->testClass()->getMethod('returnsString')->getReturnTypeName()); - } - - #[@test] - public function method_void_return_type() { - $this->assertEquals(Type::$VOID, $this->testClass()->getMethod('returnsNothing')->getReturnType()); - } - - #[@test] - public function method_noreturn_type() { - $this->assertEquals(Type::$VOID, $this->testClass()->getMethod('returnsNoreturn')->getReturnType()); - } - - #[@test] - public function method_this_return_type() { - $this->assertEquals($this->testClass(), $this->testClass()->getMethod('returnsThis')->getReturnType()); - } - - #[@test] - public function method_self_return_type() { - $this->assertEquals($this->testClass(), $this->testClass()->getMethod('returnsSelf')->getReturnType()); - } - - #[@test] - public function method_num_return_type() { - $this->assertEquals(new TypeUnion([Primitive::$INT, Primitive::$FLOAT]), $this->testClass()->getMethod('returnsNum')->getReturnType()); - } - - #[@test] - public function method_arraykey_return_type() { - $this->assertEquals(new TypeUnion([Primitive::$INT, Primitive::$STRING]), $this->testClass()->getMethod('returnsArraykey')->getReturnType()); - } - - #[@test] - public function method_int_param_type() { - $this->assertEquals(Primitive::$INT, $this->testClass()->getMethod('returnsNothing')->getParameter(0)->getType()); - } - - #[@test] - public function method_self_param_type() { - $this->assertEquals($this->testClass(), $this->testClass()->getMethod('returnsSelf')->getParameter(0)->getType()); - } - - #[@test] - public function method_int_param_type_name() { - $this->assertEquals('int', $this->testClass()->getMethod('returnsNothing')->getParameter(0)->getTypeName()); - } - - #[@test] - public function typed_field_type() { - $this->assertEquals(Primitive::$BOOL, $this->testClass()->getField('typed')->getType()); - } - - #[@test] - public function typed_field_type_name() { - $this->assertEquals('bool', $this->testClass()->getField('typed')->getTypeName()); - } - - #[@test] - public function untyped_field_type() { - $this->assertEquals(Type::$VAR, $this->testClass()->getField('untyped')->getType()); - } - - #[@test] - public function untyped_field_type_name() { - $this->assertEquals('var', $this->testClass()->getField('untyped')->getTypeName()); - } - - #[@test] - public function is_enum() { - $this->assertTrue($this->enumClass()->isEnum()); - } - - #[@test] - public function enum_values() { - $values= []; - foreach (Enum::valuesOf($this->enumClass()) as $value) { - $values[$value->name()]= $value->ordinal(); - } - $this->assertEquals(['SMALL' => 0, 'MEDIUM' => 1, 'LARGE' => 2, 'X_LARGE' => 3], $values); - } - - #[@test] - public function enum_valueOf() { - $this->assertEquals(1, Enum::valueOf($this->enumClass(), 'MEDIUM')->ordinal()); - } - - #[@test, @expect(IllegalArgumentException::class)] - public function enum_valueOf_nonexistant() { - Enum::valueOf($this->enumClass(), 'does-not-exist'); - } -} \ No newline at end of file From c385f5117ade3318aac1d8c0d030eaa246ad58ad Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:34:42 +0200 Subject: [PATCH 16/22] Remove HHVM-conditional stream_set_read_buffer() invocation --- src/main/php/util/Random.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/php/util/Random.class.php b/src/main/php/util/Random.class.php index 2bdd1a3b74..f4b9b8ba51 100755 --- a/src/main/php/util/Random.class.php +++ b/src/main/php/util/Random.class.php @@ -109,8 +109,7 @@ private static function urandom($limit) { throw new IOException('Not a character device: /dev/urandom'); } - // HHVM does not have stream_set_read_buffer()! - function_exists('stream_set_read_buffer') && stream_set_read_buffer($f, 0); + stream_set_read_buffer($f, 0); $bytes= fread($f, $limit); fclose($f); return $bytes; From b7fdea31528670740116efc6b9bfd580e818858b Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:41:46 +0200 Subject: [PATCH 17/22] Remove assertions testing for "--php" command line argument --- .../xp_framework/unittest/core/ProcessTest.class.php | 3 --- .../unittest/core/RuntimeInstantiationTest.class.php | 11 +++++------ .../unittest/core/RuntimeOptionsTest.class.php | 3 --- .../xp_framework/unittest/core/RuntimeTest.class.php | 1 - 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php index d24565131f..0deb37ff75 100644 --- a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php @@ -40,9 +40,6 @@ private function executable() { * @return string[] */ private function arguments(... $args) { - if (defined('HHVM_VERSION')) { - array_unshift($args, '--php'); - } return $args; } diff --git a/src/test/php/net/xp_framework/unittest/core/RuntimeInstantiationTest.class.php b/src/test/php/net/xp_framework/unittest/core/RuntimeInstantiationTest.class.php index e9b9ba4edd..3ecb9b67d8 100755 --- a/src/test/php/net/xp_framework/unittest/core/RuntimeInstantiationTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/RuntimeInstantiationTest.class.php @@ -1,9 +1,8 @@ assertEquals( '+OK No exception thrown', @@ -72,7 +71,7 @@ public function loadLoadedLibrary() { ); } - #[@test, @action(new IgnoredOnHHVM())] + #[@test] public function loadNonExistantLibrary() { $this->assertEquals( '+OK lang.ElementNotFoundException', @@ -87,7 +86,7 @@ public function loadNonExistantLibrary() { ); } - #[@test, @action(new IgnoredOnHHVM())] + #[@test] public function loadLibraryWithoutEnableDl() { $this->assertEquals( '+OK lang.IllegalAccessException', diff --git a/src/test/php/net/xp_framework/unittest/core/RuntimeOptionsTest.class.php b/src/test/php/net/xp_framework/unittest/core/RuntimeOptionsTest.class.php index 3fc21abacc..1d254ba051 100644 --- a/src/test/php/net/xp_framework/unittest/core/RuntimeOptionsTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/RuntimeOptionsTest.class.php @@ -16,9 +16,6 @@ class RuntimeOptionsTest extends \unittest\TestCase { * @param lang.RuntimeOptions $actual */ private function assertArguments($expected, $actual) { - if (defined('HHVM_VERSION')) { - array_unshift($expected, '--php'); - } $this->assertEquals($expected, $actual->asArguments()); } diff --git a/src/test/php/net/xp_framework/unittest/core/RuntimeTest.class.php b/src/test/php/net/xp_framework/unittest/core/RuntimeTest.class.php index 743f8ffea5..524b24f342 100644 --- a/src/test/php/net/xp_framework/unittest/core/RuntimeTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/RuntimeTest.class.php @@ -17,7 +17,6 @@ class RuntimeTest extends \unittest\TestCase { * @throws unittest.AssertionFailedError */ private function assertArguments($expected, $actual) { - defined('HHVM_VERSION') && array_unshift($expected, '--php'); $this->assertEquals($expected, $actual->asArguments()); } From 33a29f0d0fd50c10f7185b4bed5b1a1bf4fe837f Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:43:56 +0200 Subject: [PATCH 18/22] Remove test for HHVM in typed variadic args test --- .../xp_framework/unittest/core/NewInstanceTest.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php b/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php index b491f21299..ec67608dde 100644 --- a/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php @@ -1,8 +1,8 @@ runInNewRuntime(' class Test { From dc46cc7d68619efd2b82ad3ff6ed88dd2eb65e2b Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:44:13 +0200 Subject: [PATCH 19/22] Remove IgnoredOnHHVM test action and all its uses --- .../unittest/IgnoredOnHHVM.class.php | 61 ------------------- .../unittest/core/BootstrapTest.class.php | 5 +- .../unittest/core/EnvironmentTest.class.php | 2 - .../unittest/core/ErrorsTest.class.php | 11 ++-- .../unittest/core/TypeOfTest.class.php | 5 +- .../unittest/io/DomApiStreamsTest.class.php | 2 - .../Bz2CompressingOutputStreamTest.class.php | 8 +-- .../reflection/ClassDetailsTest.class.php | 4 +- .../reflection/MethodParametersTest.class.php | 6 +- .../MethodReturnTypesTest.class.php | 3 +- .../unittest/util/DateTest.class.php | 9 ++- 11 files changed, 21 insertions(+), 95 deletions(-) delete mode 100755 src/test/php/net/xp_framework/unittest/IgnoredOnHHVM.class.php diff --git a/src/test/php/net/xp_framework/unittest/IgnoredOnHHVM.class.php b/src/test/php/net/xp_framework/unittest/IgnoredOnHHVM.class.php deleted file mode 100755 index 91b5c5cef4..0000000000 --- a/src/test/php/net/xp_framework/unittest/IgnoredOnHHVM.class.php +++ /dev/null @@ -1,61 +0,0 @@ -assertEquals(255, $r[0], 'exitcode'); } - #[@test, @action(new IgnoredOnHHVM())] + #[@test] public function fatalsForEmptyTimezone() { $this->runWithTz(''); } - #[@test, @action(new IgnoredOnHHVM())] + #[@test] public function fatalsForInvalidTimezone() { $this->runWithTz('Foo/bar'); } diff --git a/src/test/php/net/xp_framework/unittest/core/EnvironmentTest.class.php b/src/test/php/net/xp_framework/unittest/core/EnvironmentTest.class.php index cabd8553fc..5ec824f57c 100755 --- a/src/test/php/net/xp_framework/unittest/core/EnvironmentTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/EnvironmentTest.class.php @@ -3,9 +3,7 @@ use lang\Environment; use lang\IllegalArgumentException; use lang\IllegalStateException; -use net\xp_framework\unittest\IgnoredOnHHVM; -#[@action(new IgnoredOnHHVM())] class EnvironmentTest extends \unittest\TestCase { private static $set; diff --git a/src/test/php/net/xp_framework/unittest/core/ErrorsTest.class.php b/src/test/php/net/xp_framework/unittest/core/ErrorsTest.class.php index a29aedfa97..6f87f04fa3 100644 --- a/src/test/php/net/xp_framework/unittest/core/ErrorsTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/ErrorsTest.class.php @@ -9,13 +9,13 @@ Value, XPException }; +use unittest\TestCase; use unittest\actions\RuntimeVersion; -use net\xp_framework\unittest\IgnoredOnHHVM; /** * Test the XP error handling semantics */ -class ErrorsTest extends \unittest\TestCase { +class ErrorsTest extends TestCase { /** * Setup method. Ensures xp error registry is initially empty and @@ -94,7 +94,7 @@ public function undefined_map_key_yields_ioobe() { $a['test']; } - #[@test, @expect(IndexOutOfBoundsException::class), @action(new IgnoredOnHHVM())] + #[@test, @expect(IndexOutOfBoundsException::class)] public function undefined_string_offset_yields_ioobe() { $a= ''; $a{0}; @@ -120,10 +120,7 @@ public function missing_argument_mismatch_yield_iae() { $f(); } - #[@test, @expect(Error::class), @action([ - # new IgnoredOnHHVM(), - # new RuntimeVersion('>=7.1.0-dev') - #])] + #[@test, @expect(Error::class), @action(new RuntimeVersion('>=7.1.0-dev'))] public function missing_argument_mismatch_yield_error() { $f= function($arg) { }; $f(); diff --git a/src/test/php/net/xp_framework/unittest/core/TypeOfTest.class.php b/src/test/php/net/xp_framework/unittest/core/TypeOfTest.class.php index 6bfbc432a7..4b92e2eff6 100644 --- a/src/test/php/net/xp_framework/unittest/core/TypeOfTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/TypeOfTest.class.php @@ -2,7 +2,6 @@ use lang\{Primitive, Type, XPClass, ArrayType, MapType, FunctionType}; use unittest\actions\RuntimeVersion; -use net\xp_framework\unittest\IgnoredOnHHVM; /** * Tests typeof() functionality @@ -64,7 +63,7 @@ public function function_with_normal_and_var_arg() { $this->assertEquals(FunctionType::forName('function(lang.Type): var'), typeof(function(Type $t, ... $a) { })); } - #[@test, @action([new RuntimeVersion('>=7.0'), new IgnoredOnHHVM()])] + #[@test, @action(new RuntimeVersion('>=7.0'))] public function function_with_typed_var_arg() { $this->assertEquals(FunctionType::forName('function(): var'), typeof(eval('return function(\lang\Type... $a) { };'))); } @@ -99,7 +98,7 @@ public function function_with_primitive_return_type() { $this->assertEquals(FunctionType::forName('function(): int'), typeof(eval('return function(): int { };'))); } - #[@test, @action([new RuntimeVersion('>=7.1'), new IgnoredOnHHVM()])] + #[@test, @action(new RuntimeVersion('>=7.1'))] public function function_with_void_return_type() { $this->assertEquals(FunctionType::forName('function(): void'), typeof(eval('return function(): void { };'))); } diff --git a/src/test/php/net/xp_framework/unittest/io/DomApiStreamsTest.class.php b/src/test/php/net/xp_framework/unittest/io/DomApiStreamsTest.class.php index e8db5565f6..e03888d1c7 100644 --- a/src/test/php/net/xp_framework/unittest/io/DomApiStreamsTest.class.php +++ b/src/test/php/net/xp_framework/unittest/io/DomApiStreamsTest.class.php @@ -2,7 +2,6 @@ use io\streams\{MemoryInputStream, MemoryOutputStream, Streams}; use lang\Runtime; -use net\xp_framework\unittest\IgnoredOnHHVM; use unittest\PrerequisitesNotMetError; /** @@ -11,7 +10,6 @@ * @see php://DOMDocument * @see xp://io.streams.Streams */ -#[@action(new IgnoredOnHHVM())] class DomApiStreamsTest extends \unittest\TestCase { /** diff --git a/src/test/php/net/xp_framework/unittest/io/streams/Bz2CompressingOutputStreamTest.class.php b/src/test/php/net/xp_framework/unittest/io/streams/Bz2CompressingOutputStreamTest.class.php index 3ae6f9573c..86863aa909 100644 --- a/src/test/php/net/xp_framework/unittest/io/streams/Bz2CompressingOutputStreamTest.class.php +++ b/src/test/php/net/xp_framework/unittest/io/streams/Bz2CompressingOutputStreamTest.class.php @@ -1,15 +1,13 @@ parseDetails('assertInstanceOf(Name::class, $actual['class'][DETAIL_ANNOTATIONS]['value']); diff --git a/src/test/php/net/xp_framework/unittest/reflection/MethodParametersTest.class.php b/src/test/php/net/xp_framework/unittest/reflection/MethodParametersTest.class.php index a164d2dad9..a8a3d98a6c 100755 --- a/src/test/php/net/xp_framework/unittest/reflection/MethodParametersTest.class.php +++ b/src/test/php/net/xp_framework/unittest/reflection/MethodParametersTest.class.php @@ -1,7 +1,5 @@ assertEquals($expected, $this->method($declaration.' { }')->getParameter(0)->toString()); } - #[@test, @action(new IgnoredOnHHVM())] + #[@test] public function variadic_via_syntax_with_type() { $param= $this->method('function fixture(string... $args) { }')->getParameter(0); $this->assertEquals( diff --git a/src/test/php/net/xp_framework/unittest/reflection/MethodReturnTypesTest.class.php b/src/test/php/net/xp_framework/unittest/reflection/MethodReturnTypesTest.class.php index 328a0cc39c..25779ef634 100755 --- a/src/test/php/net/xp_framework/unittest/reflection/MethodReturnTypesTest.class.php +++ b/src/test/php/net/xp_framework/unittest/reflection/MethodReturnTypesTest.class.php @@ -2,7 +2,6 @@ use lang\{Type, Primitive, ArrayType, MapType, XPClass, Value}; use unittest\actions\RuntimeVersion; -use net\xp_framework\unittest\IgnoredOnHHVM; class MethodReturnTypesTest extends MethodsTest { @@ -66,7 +65,7 @@ public function self_return_type() { $this->assertEquals($fixture, $fixture->getMethod('fixture')->getReturnType()); } - #[@test, @action([new RuntimeVersion('>=7.1'), new IgnoredOnHHVM()])] + #[@test, @action([new RuntimeVersion('>=7.1')])] public function void_return_type() { $fixture= $this->type('{ public function fixture(): void { } }'); $this->assertEquals(Type::$VOID, $fixture->getMethod('fixture')->getReturnType()); diff --git a/src/test/php/net/xp_framework/unittest/util/DateTest.class.php b/src/test/php/net/xp_framework/unittest/util/DateTest.class.php index 0b5b2a1287..3ba5187301 100644 --- a/src/test/php/net/xp_framework/unittest/util/DateTest.class.php +++ b/src/test/php/net/xp_framework/unittest/util/DateTest.class.php @@ -1,10 +1,9 @@ Date: Sat, 29 Sep 2018 14:45:19 +0200 Subject: [PATCH 20/22] Remove test for HHVM for void, iterable, typed variadics --- .../xp_framework/unittest/core/NewInstanceTest.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php b/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php index ec67608dde..a23aaf01f9 100644 --- a/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/NewInstanceTest.class.php @@ -492,7 +492,6 @@ public abstract function fixture(string $arg); #[@test, @action([ # new VerifyThat('processExecutionEnabled'), - # new VerifyThat(function() { return !defined('HHVM_VERSION'); }), # new RuntimeVersion('>=7.1') #])] public function declaration_with_iterable_typehint() { @@ -529,7 +528,6 @@ public abstract function fixture(object $args); #[@test, @action([ # new VerifyThat('processExecutionEnabled'), - # new VerifyThat(function() { return !defined('HHVM_VERSION'); }), # new RuntimeVersion('>=7.1') #])] public function declaration_with_void_return() { @@ -562,10 +560,7 @@ public abstract function fixture(... $args); ); } - #[@test, @action([ - # new VerifyThat('processExecutionEnabled'), - # new VerifyThat(function() { return !defined('HHVM_VERSION'); }) - #])] + #[@test, @action(new VerifyThat('processExecutionEnabled'))] public function declaration_with_typed_variadic() { $r= $this->runInNewRuntime(' abstract class Base { From 845f8bf90dfe9283d5aadccd0f687276430f85dd Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:47:26 +0200 Subject: [PATCH 21/22] Inline arguments() function previously responsible for handling "--php" arg --- .../unittest/core/ProcessTest.class.php | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php index 0deb37ff75..85e1dfa05a 100644 --- a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php @@ -33,16 +33,6 @@ private function executable() { return Runtime::getInstance()->getExecutable()->getFilename(); } - /** - * Return executable arguments. Takes care of prepending `--php` for HHVM. - * - * @param string... $args - * @return string[] - */ - private function arguments(... $args) { - return $args; - } - /** * Test process status information methods * @@ -53,7 +43,7 @@ private function arguments(... $args) { */ #[@test] public function information() { - $p= new Process($this->executable(), $this->arguments('-v')); + $p= new Process($this->executable(), ['-v']); try { $this->assertEquals(-1, $p->exitValue(), 'Process should not have exited yet'); $this->assertNotEquals(0, $p->getProcessId()); @@ -68,41 +58,40 @@ public function information() { #[@test] public function newInstance() { - $p= Runtime::getInstance()->getExecutable()->newInstance($this->arguments('-v')); - $version= defined('HHVM_VERSION') ? 'HipHop VM '.HHVM_VERSION : 'PHP '.PHP_VERSION; - $this->assertEquals($version, $p->out->read(strlen($version))); + $p= Runtime::getInstance()->getExecutable()->newInstance(['-v']); + $this->assertEquals('PHP '.PHP_VERSION, $p->out->read(strlen($version))); $p->close(); } #[@test] public function exitValueReturnedFromClose() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(0);')); + $p= new Process($this->executable(), ['-r', 'exit(0);']); $this->assertEquals(0, $p->close()); } #[@test] public function nonZeroExitValueReturnedFromClose() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(2);')); + $p= new Process($this->executable(), ['-r', 'exit(2);']); $this->assertEquals(2, $p->close()); } #[@test] public function exitValue() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(0);')); + $p= new Process($this->executable(), ['-r', 'exit(0);']); $p->close(); $this->assertEquals(0, $p->exitValue()); } #[@test] public function nonZeroExitValue() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(2);')); + $p= new Process($this->executable(), ['-r', 'exit(2);']); $p->close(); $this->assertEquals(2, $p->exitValue()); } #[@test] public function stdIn() { - $p= new Process($this->executable(), $this->arguments('-r', 'fprintf(STDOUT, fread(STDIN, 0xFF));')); + $p= new Process($this->executable(), ['-r', 'fprintf(STDOUT, fread(STDIN, 0xFF));']); $p->in->write('IN'); $p->in->close(); $out= $p->out->read(); @@ -112,7 +101,7 @@ public function stdIn() { #[@test] public function stdOut() { - $p= new Process($this->executable(), $this->arguments('-r', 'fprintf(STDOUT, "OUT");')); + $p= new Process($this->executable(), ['-r', 'fprintf(STDOUT, "OUT");']); $out= $p->out->read(); $p->close(); $this->assertEquals('OUT', $out); @@ -120,7 +109,7 @@ public function stdOut() { #[@test] public function stdErr() { - $p= new Process($this->executable(), $this->arguments('-r', 'fprintf(STDERR, "ERR");')); + $p= new Process($this->executable(), ['-r', 'fprintf(STDERR, "ERR");']); $err= $p->err->read(); $p->close(); $this->assertEquals('ERR', $err); @@ -156,7 +145,7 @@ public function getByProcessId() { #[@test] public function doubleClose() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(222);')); + $p= new Process($this->executable(), ['-r', 'exit(222);']); $this->assertEquals(222, $p->close()); $this->assertEquals(222, $p->close()); } @@ -168,7 +157,7 @@ public function closingProcessByProcessId() { #[@test] public function hugeStdout() { - $p= new Process($this->executable(), $this->arguments('-r', 'fputs(STDOUT, str_repeat("*", 65536));')); + $p= new Process($this->executable(), ['-r', 'fputs(STDOUT, str_repeat("*", 65536));']); $out= ''; while (!$p->out->eof()) { $out.= $p->out->read(); @@ -179,7 +168,7 @@ public function hugeStdout() { #[@test] public function hugeStderr() { - $p= new Process($this->executable(), $this->arguments('-r', 'fputs(STDERR, str_repeat("*", 65536));')); + $p= new Process($this->executable(), ['-r', 'fputs(STDERR, str_repeat("*", 65536));']); $err= ''; while (!$p->err->eof()) { $err.= $p->err->read(); @@ -190,7 +179,7 @@ public function hugeStderr() { #[@test] public function new_process_is_running() { - $p= new Process($this->executable(), $this->arguments('-r', 'fgets(STDIN, 8192);')); + $p= new Process($this->executable(), ['-r', 'fgets(STDIN, 8192);']); $this->assertTrue($p->running()); $p->in->writeLine(); $p->close(); @@ -198,7 +187,7 @@ public function new_process_is_running() { #[@test] public function process_is_not_running_after_it_exited() { - $p= new Process($this->executable(), $this->arguments('-r', 'exit(0);')); + $p= new Process($this->executable(), ['-r', 'exit(0);']); $p->close(); $this->assertFalse($p->running()); } @@ -211,7 +200,7 @@ public function runtime_is_running() { #[@test] public function mirror_is_not_running() { - $p= new Process($this->executable(), $this->arguments('-r', 'fgets(STDIN, 8192); exit(0);')); + $p= new Process($this->executable(), ['-r', 'fgets(STDIN, 8192); exit(0);']); $mirror= Process::getProcessById($p->getProcessId()); $p->in->write("\n"); $p->close(); @@ -220,14 +209,14 @@ public function mirror_is_not_running() { #[@test] public function terminate() { - $p= new Process($this->executable(), $this->arguments('-r', 'sleep(10);')); + $p= new Process($this->executable(), ['-r', 'sleep(10);']); $p->terminate(); $this->assertNotEquals(0, $p->close()); } #[@test] public function terminate_not_owned() { - $p= new Process($this->executable(), $this->arguments('-r', 'sleep(10);')); + $p= new Process($this->executable(), ['-r', 'sleep(10);']); Process::getProcessById($p->getProcessId())->terminate(); $this->assertNotEquals(0, $p->close()); } From 91d1f50f1037f047cd8d80ed776ee508ea0245ed Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 29 Sep 2018 14:52:47 +0200 Subject: [PATCH 22/22] Fix refactoring error --- .../php/net/xp_framework/unittest/core/ProcessTest.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php index 85e1dfa05a..1e43668812 100644 --- a/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php +++ b/src/test/php/net/xp_framework/unittest/core/ProcessTest.class.php @@ -59,7 +59,8 @@ public function information() { #[@test] public function newInstance() { $p= Runtime::getInstance()->getExecutable()->newInstance(['-v']); - $this->assertEquals('PHP '.PHP_VERSION, $p->out->read(strlen($version))); + $version= 'PHP '.PHP_VERSION; + $this->assertEquals($version, $p->out->read(strlen($version))); $p->close(); }