Skip to content

Fix testMemoryLimit on PHP installed using Nix #958

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

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Nov 8, 2022

With PHP from Nix php_ini_loaded_file() returns false as the setup does not have a root php.ini

The test just assert was just wrong

1) Symfony\Flex\Tests\ScriptExecutorTest::testMemoryLimit
Expectation failed for method name is "execute" when invoked zero or more times
Parameter 0 for invocation Composer\Util\ProcessExecutor::execute(''/nix/store/x8czkm08bkf1979pf...nd.php', Closure Object (...), null): int does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''/nix/store/x8czkm08bkf1979pfv1f4d9h2zgh8k9n-php-with-extensions-8.1.12/bin/php' '--php-ini=' '-d memory_limit=32M' ./command.php'
+''/nix/store/x8czkm08bkf1979pfv1f4d9h2zgh8k9n-php-with-extensions-8.1.12/bin/php' '-d memory_limit=32M' ./command.php'

/Users/shyim/Code/flex-plugin/src/ScriptExecutor.php:58
/Users/shyim/Code/flex-plugin/tests/ScriptExecutorTest.php:56

@shyim shyim force-pushed the fix-test-on-nix-based-php branch from ea1ed64 to 5b8dfa3 Compare November 8, 2022 12:41
@nicolas-grekas nicolas-grekas merged commit dd57919 into symfony:1.x Jan 30, 2023
@nicolas-grekas
Copy link
Member

Thank you @shyim

@shyim shyim deleted the fix-test-on-nix-based-php branch January 30, 2023 16:22
@nicolas-grekas
Copy link
Member

Thank you @shyim.

nicolas-grekas added a commit that referenced this pull request Jan 30, 2023
This PR was merged into the 1.x branch.

Discussion
----------

Fix testMemoryLimit on PHP installed using Nix

With PHP from Nix `php_ini_loaded_file()` returns false as the setup does not have a root `php.ini`

The test just assert was just wrong

```
1) Symfony\Flex\Tests\ScriptExecutorTest::testMemoryLimit
Expectation failed for method name is "execute" when invoked zero or more times
Parameter 0 for invocation Composer\Util\ProcessExecutor::execute(''/nix/store/x8czkm08bkf1979pf...nd.php', Closure Object (...), null): int does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-''/nix/store/x8czkm08bkf1979pfv1f4d9h2zgh8k9n-php-with-extensions-8.1.12/bin/php' '--php-ini=' '-d memory_limit=32M' ./command.php'
+''/nix/store/x8czkm08bkf1979pfv1f4d9h2zgh8k9n-php-with-extensions-8.1.12/bin/php' '-d memory_limit=32M' ./command.php'

/Users/shyim/Code/flex-plugin/src/ScriptExecutor.php:58
/Users/shyim/Code/flex-plugin/tests/ScriptExecutorTest.php:56
```

Commits
-------

5b8dfa3 Fix testMemoryLimit on PHP installed using Nix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants