Пример #1
0
 public function testErrorRequest()
 {
     $stub = new ClientStub(function ($request, $response) {
         $response->setHeaders(array('HTTP/1.1 200 Ok'));
         $response->setContent('<root><status>err</status></root>');
     });
     $client = new Client($this->getConfig(), $stub);
     $request = new RequestStub();
     $response = $client->request($request);
     $this->assertInstanceOf('Gordalina\\Easypay\\Response\\ResponseInterface', $response);
     $this->assertFalse($response->isValid());
     $this->assertSame('error', $response->getMessage());
 }
Пример #2
0
 protected function getClient()
 {
     $client = new Client($this->getConfig());
     $client->setSandbox(true);
     return $client;
 }