public function testToString() { $url = new Url(''); $this->assertEquals('', $url->toString()); $url = new Url('foo'); $this->assertEquals('', $url->toString()); $_SERVER['SCRIPT_NAME'] = '/home/travis/index.php'; $url = new Url('http://localhost/thumb/d/foo/bar/demo,w_100.jpg'); $url->setUrlImageName('demo,w_200.jpg'); $this->assertEquals('http://localhost/thumb/d/foo/bar/demo,w_200.jpg', $url->toString()); $url = new Url('http://localhost'); $this->assertEquals('http://localhost', $url->toString()); $_SERVER['SCRIPT_NAME'] = '/home/index.php'; $url = new Url('http://localhost/thumb/d/foo/bar/demo,w_100.jpg'); $url->setUrlImageName('demo,w_200.jpg'); $this->assertEquals('http://localhost/thumb/d/foo/bar/demo,w_200.jpg', $url->toString()); }
public function testToString() { $url = new Url(''); $this->assertEquals('', $url->toString()); $url = new Url('foo'); $this->assertEquals('', $url->toString()); $url = new Url('http://localhost'); $this->assertEquals('http://localhost', $url->toString()); $url = new Url('http://localhost/thumb/d/foo/bar/demo,w_100.jpg'); $url->setUrlImageName('demo,w_200.jpg'); $this->assertEquals('http://localhost/thumb/d/foo/bar/demo,w_200.jpg', $url->toString()); }