Пример #1
0
 public function testPrepareOperationSetsGuzzleCommand()
 {
     $operation = 'do stuff';
     $command = new \Desk\Relationship\Resource\EmbeddedCommand();
     /** @var \PHPUnit_Framework_MockObject_MockObject $guzzleClient */
     $guzzleClient = $this->clientCommand->getGuzzleClient();
     $guzzleClient->expects($this->once())->method('getCommand')->with($operation)->will($this->returnValue($command));
     $this->clientCommand->prepareOperation($operation);
     $this->assertEquals($command, $this->clientCommand->getCommand());
 }
Пример #2
0
 public function testValidateResponseInvalid()
 {
     $clientCommand = new ClientCommand($this->getMock('\\Desk\\Client'), $this->getMock('\\DeskModule\\Transaction\\Transaction'), $this->getMock('\\DeskModule\\Model\\Transaction\\Marshaller\\Guzzle\\Http\\Message\\RequestInterfaceToTransaction'));
     $clientCommand->setCommand(new EmbeddedCommand());
     $preExecute = new PreExecute($clientCommand);
     $response = new Model();
     $response->set('id', 0);
     $postExecute = new PostExecute($preExecute, $response);
     $this->assertFalse($postExecute->propagationIsStopped());
     $actual = $this->sut->validateResponse($postExecute);
     $this->assertTrue($postExecute->propagationIsStopped());
     $this->assertFalse($actual);
 }