Example #1
0
 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());
 }
Example #2
0
 /**
  * @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(''));
 }