Skip to content

Const PHP_BINARY breaks integration testing in windows since 2.1 #5258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
martinmonnier opened this issue Jun 25, 2016 · 2 comments
Closed
Labels
Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed non-issue

Comments

@martinmonnier
Copy link

martinmonnier commented Jun 25, 2016

Preconditions

  • Install your PHP in the common windows directory e.g. "C:\Program Files (x86)\Zend\ZendServer\bin"
  • Create a simple integration test and run this test.

Expected result

  • Test execution

Actual result

  • The test could not be executed because the php interpreter "C:\Program " could not be started during preparing the integration enviroment.

Reason

  • In File "\dev\tests\integration\framework\Magento\TestFramework\Application.php" the $this->_shell->execute()parameter uses the PHP_BINARY const without any double qoutes.
  • The error does not occurs on 2.0 because PHP_BINARY const were not used. Just the simple "php" command that will be executed by PATH variable.

Solution

  • Escaping PHP_BINARY const, so it will be called safely by $this->_shell->execute(). e.g. with escapeshellarg()
@martinmonnier
Copy link
Author

Stacktrace on test execution:
Exception: Der Befehl "C:\Program" ist entweder falsch geschrieben oder konnte nicht gefunden werden. in D:\Projekte\Magento\public_html\mycustomer\shop\vendor\magento\framework\Shell.php:61 Stack trace: #0 D:\Projekte\Magento\public_html\mycustomer\shop\dev\tests\integration\framework\Magento\TestFramework\Application.php(464): Magento\Framework\Shell->execute('C:\\Program File...', Array) #1 D:\Projekte\Magento\public_html\mycustomer\shop\dev\tests\integration\framework\bootstrap.php(68): Magento\TestFramework\Application->install() #2 D:\Projekte\Magento\public_html\mycustomer\shop\vendor\phpunit\phpunit\src\Util\Fileloader.php(93): include_once('D:\\Projekte\\Mag...') #3 D:\Projekte\Magento\public_html\mycustomer\shop\vendor\phpunit\phpunit\src\Util\Fileloader.php(77): PHPUnit_Util_Fileloader::load('D:\\Projekte\\Mag...') #4 D:\Projekte\Magento\public_html\mycustomer\shop\vendor\phpunit\phpunit\src\TextUI\Command.php(806): PHPUnit_Util_Fileloader::checkAndLoad('D:\\Projekte\\Mag...') #5 D:\Projekte\Magento\public_html\mycustomer\shop\vendor\phpunit\phpunit\src\TextUI\Command.php(636): PHPUnit_TextUI_Command->handleBootstrap('D:\\Projekte\\Mag...') #6 C:\Users\Martin Monnier\AppData\Local\Temp\ide-phpunit.php(304): PHPUnit_TextUI_Command->handleArguments(Array) #7 D:\Projekte\Magento\public_html\mycustomer\shop\vendor\phpunit\phpunit\src\TextUI\Command.php(141): IDE_Base_PHPUnit_TextUI_Command->handleArguments(Array) #8 C:\Users\Martin Monnier\AppData\Local\Temp\ide-phpunit.php(299): PHPUnit_TextUI_Command->run(Array, true) #9 C:\Users\Martin Monnier\AppData\Local\Temp\ide-phpunit.php(587): IDE_Base_PHPUnit_TextUI_Command::main() #10 {main}

@veloraven veloraven added the TECH label Jul 27, 2016
@magento-engcom-team magento-engcom-team added 2.1.x bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@orlangur
Copy link
Contributor

Try using a supported operating system: http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html. Note that Windows is not in the list.

While technically PHP_BINARY may contain space under Linux, I don't think it's worth fixing until there is a real bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed non-issue
Projects
None yet
Development

No branches or pull requests

5 participants