wp-cli/wp-cli — pull request #665 by scribu (2013-08-12 09:40:34+00:00)
Title: Can't run Behat while having community packages installed

Currently, the only way to run the functional tests is by running `composer install --dev` inside the root wp-cli dir, which will install Behat in `vendor/bin/behat`. But, if the `vendor/` dir is present, the outer `~/.wp-cli/vendor/` dir (which contains community packages such as `wp server`) is ignored.

A) If I try installing Behat in `~/.wp-cli`, when I run `~/.wp-cli/bin/behat`, I get:

```
Fatal error: Class 'WP_CLI_Command' not found in /Users/User/.wp-cli/vendor/wp-cli/server-command/command.php on line 3
```

This is because `php/class-wp-cli.php` is not specified in the autoload section of [wp-cli/composer.json](https://github.com/wp-cli/wp-cli/blob/master/composer.json). If it were, the assumption made in #571 (that core WP-CLI files would be loaded before `autoload.php`) would no longer be true.

So, this is a dead end.

B) If I download `behat.phar`, when I try to use it, I get:

```
Fatal error: require_once(): Failed opening required 'PHPUnit/Framework/Assert/Functions.php' (include_path='.:/usr/local/Cellar/php55/5.5.1/lib/php') in /Users/User/.wp-cli/vendor/wp-cli/wp-cli/features/bootstrap/FeatureContext.php on line 10
```

If I download and use `phpunit.phar`, it works fine.

So, it seems like the easiest solution would be to stop using PHPUnit assertions in Behat steps, which doesn't seem too hard to do.

Tasks:

* [ ] remove PHPUnit assertions from `features/steps/basic_steps.php`
* [ ] remove dev dependencies from `composer.json`
* [ ] update `CONTRIBUTING.md`