Skip to content

Fix testMemoryLimit on PHP installed using Nix#958

Merged
nicolas-grekas merged 1 commit intosymfony:1.xfrom
shyim:fix-test-on-nix-based-php
Jan 30, 2023
Merged

Fix testMemoryLimit on PHP installed using Nix#958
nicolas-grekas merged 1 commit intosymfony:1.xfrom
shyim:fix-test-on-nix-based-php

Conversation

@shyim
Copy link
Copy Markdown
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
Copy Markdown
Member

Thank you @shyim

@shyim shyim deleted the fix-test-on-nix-based-php branch January 30, 2023 16:22
@nicolas-grekas
Copy link
Copy Markdown
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