2

I have followed official docs on how to use behat with symfony2.

But when i run command

$ php bin/behat --init "@FootprintsRestBundle"

features directory is created in root directory instead of inside of bundle Sound similar to this issue so i tried to specify path to behat.yml manually but got same result.

I tried as well moving behat.yml to app/config, and after running

$ php bin/behat -c app/config/behat.yml --init "@FootprintsRestBundle"

features got created inside of app/config.

Other thing I tried was to use phar extension but got fatal error

$ php behat.phar --init "@FootprintsRestBundle"


PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /home/vagrant/footprints/vendor/composer/autoload_real.php on line 36
PHP Stack trace:
PHP   1. {main}() /home/vagrant/footprints/behat.phar:0
PHP   2. Symfony\Component\Console\Application->run() /home/vagrant/footprints/behat.phar:26
PHP   3. Behat\Behat\Console\BehatApplication->doRun() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
PHP   4. Behat\Behat\Console\BehatApplication->createCommand() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:66
PHP   5. Behat\Behat\Console\BehatApplication->createContainer() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:80
PHP   6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:94
PHP   7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php:553
PHP   8. Behat\Symfony2Extension\Compiler\KernelInitializationPass->process() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php:119
PHP   9. require_once() phar:///home/vagrant/footprints/symfony2_extension.phar/src/Behat/Symfony2Extension/Compiler/KernelInitializationPass.php:42
PHP  10. require() /home/vagrant/footprints/app/autoload.php:9
PHP  11. ComposerAutoloaderInit0c3e5b20fed9b462369cb56a81ea018b::getLoader() /home/vagrant/footprints/vendor/autoload.php:7

Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /home/vagrant/footprints/vendor/composer/autoload_real.php on line 36

Call Stack:
    0.0126     533576   1. {main}() /home/vagrant/footprints/behat.phar:0
    0.0217    1426648   2. Symfony\Component\Console\Application->run() /home/vagrant/footprints/behat.phar:26
    0.0263    1743184   3. Behat\Behat\Console\BehatApplication->doRun() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:106
    0.0263    1743232   4. Behat\Behat\Console\BehatApplication->createCommand() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:66
    0.0263    1743304   5. Behat\Behat\Console\BehatApplication->createContainer() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:80
    0.0769    4302288   6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() phar:///home/vagrant/footprints/behat.phar/src/Behat/Behat/Console/BehatApplication.php:94
    0.0781    4308960   7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php:553
    0.0787    4312008   8. Behat\Symfony2Extension\Compiler\KernelInitializationPass->process() phar:///home/vagrant/footprints/behat.phar/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Compiler/Compiler.php:119
    0.0794    4314440   9. require_once('/home/vagrant/footprints/app/autoload.php') phar:///home/vagrant/footprints/symfony2_extension.phar/src/Behat/Symfony2Extension/Compiler/KernelInitializationPass.php:42
    0.0800    4316112  10. require('/home/vagrant/footprints/vendor/autoload.php') /home/vagrant/footprints/app/autoload.php:9
    0.0806    4328488  11. ComposerAutoloaderInit0c3e5b20fed9b462369cb56a81ea018b::getLoader() /home/vagrant/footprints/vendor/autoload.php:7
Community
  • 1
  • 1
Gustek
  • 3,680
  • 2
  • 22
  • 36
  • Paste your behat.yml please. Have you enabled the Symfony extension? Which version of Behat are you trying to use? Docs are not yet updated for Behat 3. – Jakub Zalas May 06 '14 at 21:04
  • I have changed version of behat to v2.5.2 and symfony extension to v1.1.2 in composer and it works now ;] Will wait with with use of version 3 until docs get updated. Thanks @Jakub Zalas. – Gustek May 06 '14 at 22:41
  • @Gustek did you change the version of behat in composer.lock ? – Vamsi Krishna B Jul 17 '14 at 10:00
  • All of it was in dev environment so I did composer update. – Gustek Jul 17 '14 at 20:28

0 Answers0