/** * @test */ public function getByNotificationShouldDoAGetRequestAddingCredentialsData() { $xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8"?><data />'); $this->client->expects($this->once())->method('get')->with('https://ws.test.com/v2/transactions/notifications/1?email=a%40a.com&token=t')->willReturn($xml); $this->decoder->expects($this->once())->method('decode')->with($xml)->willReturn($this->transaction); $service = new Locator($this->credentials, $this->client, $this->decoder); $this->assertSame($this->transaction, $service->getByNotification(1)); }