function testUrlAccessor() { $headers = new MockSimpleHttpHeaders(); $response = new MockSimpleHttpResponse(); $response->setReturnValue('getHeaders', $headers); $response->setReturnValue('getMethod', 'POST'); $response->setReturnValue('getUrl', new SimpleUrl('here')); $response->setReturnValue('getRequestData', array('a' => 'A')); $page = new SimplePage($response); $this->assertEqual($page->getMethod(), 'POST'); $this->assertEqual($page->getUrl(), new SimpleUrl('here')); $this->assertEqual($page->getRequestData(), array('a' => 'A')); }
/** * Accessor for current URL of page or frame if * focused. * @return string Location of current page or frame as * a string. */ function getUrl() { $url = $this->page->getUrl(); return $url ? $url->asString() : false; }