Skip to content
Snippets Groups Projects
Commit 703dcd20 authored by David Alger's avatar David Alger
Browse files

Resolve PHP 7 unit test issues and remove allow_failures config (issue #1858)

parent da282a00
Branches
No related merge requests found
...@@ -21,8 +21,6 @@ matrix: ...@@ -21,8 +21,6 @@ matrix:
env: TEST_SUITE=static_phpcs env: TEST_SUITE=static_phpcs
- php: 5.6 - php: 5.6
env: TEST_SUITE=static_annotation env: TEST_SUITE=static_annotation
allow_failures:
- php: 7.0
before_install: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -y -qq postfix - sudo apt-get install -y -qq postfix
......
...@@ -209,13 +209,15 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase ...@@ -209,13 +209,15 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
'message' => $xdebugMessage, 'message' => $xdebugMessage,
'error' => false, 'error' => false,
], ],
'always_populate_raw_post_data' => [
'message' => $rawPostMessage,
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
'error' => false
]
] ]
]; ];
if (!$this->isPhp7OrHackLang()) {
$expected['data']['always_populate_raw_post_data'] = [
'message' => $rawPostMessage,
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
'error' => false
];
}
$this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings());
} }
...@@ -246,14 +248,16 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase ...@@ -246,14 +248,16 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
'xdebug_max_nesting_level' => [ 'xdebug_max_nesting_level' => [
'message' => $xdebugMessage, 'message' => $xdebugMessage,
'error' => true, 'error' => true,
],
'always_populate_raw_post_data' => [
'message' => $rawPostMessage,
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
'error' => false
] ]
] ]
]; ];
if (!$this->isPhp7OrHackLang()) {
$expected['data']['always_populate_raw_post_data'] = [
'message' => $rawPostMessage,
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
'error' => false
];
}
$this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings());
} }
...@@ -272,14 +276,17 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase ...@@ -272,14 +276,17 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
); );
$expected = [ $expected = [
'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS,
'data' => [ 'data' => []
];
if (!$this->isPhp7OrHackLang()) {
$expected['data'] = [
'always_populate_raw_post_data' => [ 'always_populate_raw_post_data' => [
'message' => $rawPostMessage, 'message' => $rawPostMessage,
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
'error' => false 'error' => false
] ]
] ];
]; }
$this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings());
} }
...@@ -333,6 +340,14 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase ...@@ -333,6 +340,14 @@ class PhpReadinessCheckTest extends \PHPUnit_Framework_TestCase
]; ];
$this->assertEquals($expected, $this->phpReadinessCheck->checkPhpExtensions()); $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpExtensions());
} }
/**
* @return bool
*/
protected function isPhp7OrHackLang()
{
return version_compare(PHP_VERSION, '7.0.0-beta') >= 0 || defined('HHVM_VERSION');
}
} }
namespace Magento\Setup\Model; namespace Magento\Setup\Model;
......
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