If you have composer.json
file in your project, then you might have some custom script in the scripts
section that you want to execute via composer {script-name}
command.
For example, in your Laravel project you have phpunit
and want to create a custom script for coverage test and your composer scripts section might look like this:
"scripts": {
...
"coverage-test": [
"./vendor/bin/phpunit --coverage-html tests/Reports"
]
}
When executing this command:
composer coverage-test
there is a possibility (depending on your test cases you have) that you might get the following error:
[Symfony\Component\Process\Exception\ProcessTimedOutException]
The process "coverage-test --coverage-html tests/Reports" exceeded the timeout of 300 seconds.
You can fix it by updating your script to like this:
"scripts": {
...
"coverage-test": [
"Composer\\Config::disableProcessTimeout",
"./vendor/bin/phpunit --coverage-html tests/Reports"
]
}
If your try the command composer coverage-test
now, it should work without any errors.
References:
Top comments (0)