示例#1
0
 public function testCreateSell()
 {
     $account = Account::reference('ACCOUNT_ID');
     $sell = new Sell();
     $response = $this->getMock(ResponseInterface::class);
     $this->mapper->expects($this->any())->method('fromSell')->with($sell)->willReturn(['key' => 'value']);
     $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/sells', ['key' => 'value', 'foo' => 'bar'])->willReturn($response);
     $this->mapper->expects($this->once())->method('toSell')->with($response, $sell);
     $this->client->createAccountSell($account, $sell, ['foo' => 'bar']);
 }