public function testCommitDeposit() { $deposit = Deposit::reference('ACCOUNT_ID', 'DEPOSIT_ID'); $response = $this->getMock(ResponseInterface::class); $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/deposits/DEPOSIT_ID/commit', ['foo' => 'bar'])->willReturn($response); $this->mapper->expects($this->once())->method('toDeposit')->with($response, $deposit); $this->client->commitDeposit($deposit, ['foo' => 'bar']); }