public function testReference() { $buy = Buy::reference('ACCOUNT_ID', 'BUY_ID'); $this->assertEquals(ResourceType::BUY, $buy->getResourceType()); $this->assertEquals('/v2/accounts/ACCOUNT_ID/buys/BUY_ID', $buy->getResourcePath()); $this->assertEquals('BUY_ID', $buy->getId()); $this->assertEquals('ACCOUNT_ID', $buy->getAccountId()); }
public function testCommitBuy() { $buy = Buy::reference('ACCOUNT_ID', 'BUY_ID'); $response = $this->getMock(ResponseInterface::class); $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/buys/BUY_ID/commit', ['foo' => 'bar'])->willReturn($response); $this->mapper->expects($this->once())->method('toBuy')->with($response, $buy); $this->client->commitBuy($buy, ['foo' => 'bar']); }