guzzle/command — pull request #11 by jeremeamia (2014-06-18 23:35:00+00:00)
Title: [WIP] Added a subscriber to easily mock the results of a command.

This PR adds a subscriber to the Command package that correlates to the Mock subscriber in the Guzzle core. It allows you to mock results and exceptions at the command level. This is a rough POC that i wanted you to review. Let me know if you like it or not and if you want to change any class/method names.

Here is a example of how it is used.

```php
getEmitter());
}
}
$client = new ServiceClient(new Client);

// Setup mock plugin
$mock = new ResultMock();
$mock->addResult(new Model(['foo' => 'bar']));
$mock->addExceptionMessage('Whoops!');
$client->getEmitter()->attach($mock);

// Should return a model with ['foo' => 'bar']
print_r($client->getThing()->toArray());

// Should throw a CommandException with message "Whoops!"
try {
$client->getThing();
} catch (\Exception $e) {
echo "EXCEPTION: " . $e->getMessage() . "\n";
}
```