예제 #1
0
 /**
  * @param string $method
  * @param array $data
  * @return mixed
  */
 protected function call($method, array $data = [])
 {
     $this->client->setWsdl(self::WSDL);
     $this->client->setSchema(self::SCHEMA);
     $response = $this->client->call($method, $data);
     $this->setLastResponse($response);
     return $response;
 }
예제 #2
0
 /**
  * Set up test case.
  */
 public function setUp()
 {
     parent::setUp();
     $this->response = new \stdClass();
     $this->response->InvoiceNo = 1234;
     $this->response->NewInvoiceNo = 4321;
     $this->invoiceId = 4321;
     $this->countryCode = Country::NORWAY;
     $this->client = $this->getMockBuilder('\\Collector\\Client')->disableOriginalConstructor()->getMock();
     $this->client->expects($this->any())->method('call')->willReturnCallback(function ($method, $data) {
         $this->response->method = $method;
         $this->response->data = $data;
         return $this->response;
     });
     $this->invoiceService = new Invoice($this->client, $this->countryCode);
 }