public function testHasEffectiveUrl() { $r = new Response(200); $this->assertNull($r->getEffectiveUrl()); $r->setEffectiveUrl('http://www.test.com'); $this->assertEquals('http://www.test.com', $r->getEffectiveUrl()); }
/** * @dataProvider dataUpdateUrl */ public function testUpdateUrl($url, $expected) { $client = new Client(); $response = new Response(200, []); $response->setEffectiveUrl($expected); $mock = new Mock([new Response(200, [])]); $client->getEmitter()->attach($mock); $nothing = new Nothing($client); $this->assertEquals($expected, $nothing->updateUrl($url)); $this->assertEquals('', $nothing->updateContent('')); }