/** * @covers Guzzle\Service\Client::getCommand * @depends testMagicCallBehaviorExecuteExecutesCommands */ public function testEnablesMagicMethodCallsOnCommandsIfEnabledOnClient() { $client = new Mock\MockClient(); $command = $client->getCommand('other_command'); $this->assertNull($command->get('command.magic_method_call')); $client->setMagicCallBehavior(Client::MAGIC_CALL_EXECUTE); $command = $client->getCommand('other_command'); $this->assertTrue($command->get('command.magic_method_call')); }
/** * @covers Guzzle\Service\Client::__call */ public function testMagicCallBehaviorExecuteExecutesCommands() { $client = new Mock\MockClient(); $client->setMagicCallBehavior(Client::MAGIC_CALL_EXECUTE); $client->setDescription($this->service); $client->getEventDispatcher()->addSubscriber(new MockPlugin(array(new Response(200)))); $this->assertInstanceOf('Guzzle\\Http\\Message\\Response', $client->mockCommand()); }