Behat/Mink — pull request #230 by b00giZm (2012-04-02 15:03:46+00:00)
Title: ZombieDriver / NodeJS refactoring + improvements / fixes

## Refactoring

There's now an abstract server class for all NodeJS related testing libraries and framworks. It should now be much more easier to add support for other testing libraries (like @n1k0's [CasperJS](https://github.com/n1k0/casperjs)). The child classes will only provide the server script and handle the JavaScript evaluation.

````
src/Behat/Mink/Driver
├── DriverInterface.php
├── Goutte
│ ├── Client.php
│ └── CookieJar.php
├── GoutteDriver.php
├── NodeJS
│ ├── Connection.php
│ ├── Server
│ │ └── ZombieServer.php
│ └── Server.php
├── SahiDriver.php
├── Selenium2
│ └── syn.js
├── Selenium2Driver.php
├── SeleniumDriver.php
└── ZombieDriver.php
````
### Backwards Compatibility

Will it break BC? **Yes.** (well, kind of)

The former constructor method of the server class:

```php
public function __construct(
$host = '127.0.0.1',
$port = 8124,
$nodeBin = null,
$serverScript = null,
$threshold = 20000000
) { // ... }
```

The updated constructor method:

```php
public function __construct(
$host = '127.0.0.1',
$port = 8124,
$nodeBin = null,
$serverPath = null,
$threshold = 2000000
) { // ... }
```

I changed `$serverScript` to `$serverPath` because of the following:

* It makes more sense to provide the link to a prepared server script instead of using the generated default one, because you can then easier use a locally installed Zombie.js library instead of a global one. This might be useful if you want to experiment with different versions of Zombie.js or if you want to do something more sophisticated inside the server script (logging etc.)
* I really don't think that anyone used anything else other the default script, yet ;)

## Improvements

* I leveraged the updated [Symfony Process Component](https://github.com/symfony/Process) for non-blocking processes and threw out all the custom process code
* The server class is now more robust and has better error reporting to the client
* Support for HTTP Basic Auth (ZombieDriver)
* JSON support is back in Zombie.js

## Bug Fixes

* Fixes #225