20 $this->client =
new Client();
23 'test' =>
'Guzzle\Tests\Service\Mock\Command\MockCommand',
24 'test1' =>
'Guzzle\Tests\Service\Mock\Command\OtherCommand'
34 'bad_link' =>
'jarjar'
38 'test3' =>
'Guzzle\Tests\Service\Mock\Command\Sub\Sub'
41 $this->client->setCommandFactory(
new CompositeFactory(array($map, $this->factory, $map2)));
47 array(
'foo',
'Guzzle\Tests\Service\Mock\Command\MockCommand',
false),
48 array(
'bar',
'Guzzle\Tests\Service\Mock\Command\OtherCommand',
false),
49 array(
'sub',
'Guzzle\Tests\Service\Mock\Command\OtherCommand',
false),
50 array(
'sub_2',
'Guzzle\Tests\Service\Mock\Command\OtherCommand',
false),
51 array(
'krull',
'Guzzle\Tests\Service\Mock\Command\Sub\Sub',
false),
52 array(
'krull_2',
'Guzzle\Tests\Service\Mock\Command\Sub\Sub',
false),
53 array(
'missing',
null,
true),
54 array(
'bad_link',
null,
true)
64 $command = $this->client->getCommand($key);
65 if (is_null($result)) {
66 $this->assertNull($command);
68 $this->assertInstanceof($result, $command);
70 }
catch (\Exception $e) {
72 $this->fail(
'Got exception when it was not expected');