Install dev packages with Composer

Sometimes, you might install your dependencies via composer but find that the tests don’t work for it. You could get an error similar to the following.

phpunit
PHP Fatal error:  Class 'Symfony\Component\Yaml\Yaml' not found in
/home/example/Gherkin/src/Behat/Gherkin/Keywords/CucumberKeywords.php on line 31

This could be because if you have just run composer install, it will only install the main packages, but some packages could be specified as dev only. You may find a “require-dev” section in the composer.json file.

If you do, you can install the packages using the following flag.

composer install --dev

This will install the development packages as well, which should allow you to run the tests.

Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

Tags: , , ,

This entry was posted on Monday, April 2nd, 2012 at 3:59 pm and is filed under Programming, Tech. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.