Installed BeHat on Windows 7 but getting an error trying to run behat or behat --init

StackOverflow https://stackoverflow.com/questions/20767421

  •  21-09-2022
  •  | 
  •  

Question

I installed Behat and Mink using PEAR with all the dependencies into my Windows 7 machine. When I execute behat from a command line, I get the following PHP errors which seems to indicate that Symfony is missing, but this should have been partially installed with PHPUnit.

Command Line: behat or behat --init or behat -h

PHP Fatal error:  Class 'Symfony\Component\Console\Helper\InputAwareHelper' not
found in C:\Program Files (x86)\PHP\pear\Symfony\Component\Console\Helper\Dialog
Helper.php on line 23
PHP Stack trace:
PHP   1. {main}() C:\Program Files (x86)\PHP\behat:0
PHP   2. Behat\Behat\Console\BehatApplication->__construct() C:\Program Files (x
86)\PHP\behat:26
PHP   3. Symfony\Component\Console\Application->__construct() C:\Program Files (
x86)\PHP\pear\behat\src\Behat\Behat\Console\BehatApplication.php:32
PHP   4. Symfony\Component\Console\Application->getDefaultHelperSet() C:\Program
 Files (x86)\PHP\pear\Symfony\Component\Console\Application.php:83
PHP   5. Behat\Behat\ClassLoader\MapFileClassLoader->loadClass() C:\Program File
s (x86)\PHP\pear\Symfony\Component\Console\Application.php:0
PHP   6. require() C:\Program Files (x86)\PHP\pear\behat\src\Behat\Behat\ClassLo
ader\MapFileClassLoader.php:55

Fatal error: Class 'Symfony\Component\Console\Helper\InputAwareHelper' not found
 in C:\Program Files (x86)\PHP\pear\Symfony\Component\Console\Helper\DialogHelpe
r.php on line 23

To install Behat, I ran a command shell as Administrator then did:

pear config-set auto_discover 1
pear channel-discover pear.behat.org
pear install --alldeps behat/behat

pear install --alldeps behat/mink

The installer shows Behat to be 2.3.5 and Mink to be 1.3.3. Trying to simply install them again, PEAR reports they are installed.

Was it helpful?

Solution

Use composer to install Behat (v2 or v3).

Pear channel is no longer maintained and you can only install old versions with it (up to 2.3.5, so no >2.5 or 3.0).

Symfony channel is no longer maintained either and you might have problems resolving those dependencies too.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top