0
votes

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.

1
Several potential problems: 1) Behat doesn't necessarily like pathnames with spaces in them: github.com/Behat/Behat/issues/156. 2) You might need to specify bundles with respect to your src/ folder: stackoverflow.com/questions/9898504/…. - paulsm4
I created my test directory in A:\Behat-Test to simply try my first test. A:\ is subst from C:\Development. However, PHP is installed in C:\Program Files (x86)\php. I did try installing it into Ubuntu 13.04, into /home/plex (my user) and I get the same error when running behat, or behat --init, except the paths are relative to Linux. - Steven Scott

1 Answers

-1
votes

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.