function testRelativeFramesRespectBaseTag() { $response = new MockSimpleHttpResponse(); $response->setReturnValue('getUrl', new SimpleUrl('http://here.com/')); $page = new SimplePage($response); $base = new SimpleBaseTag(array('href' => 'https://there.com/stuff/')); $page->AcceptTag($base); $page->acceptFramesetStart(new SimpleTag('frameset', array())); $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); $page->acceptFramesetEnd(); $this->assertIdentical($page->getFrameset(), array(1 => new SimpleUrl('https://there.com/stuff/1.html'))); }
function testNamedFramesInPage() { $response = new MockSimpleHttpResponse(); $response->setReturnValue('getUrl', new SimpleUrl('http://here')); $page = new SimplePage($response); $page->acceptFramesetStart(new SimpleTag('frameset', array())); $page->acceptFrame(new SimpleFrameTag(array('src' => '1.html'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '2.html', 'name' => 'A'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '3.html', 'name' => 'B'))); $page->acceptFrame(new SimpleFrameTag(array('src' => '4.html'))); $page->acceptFramesetEnd(); $this->assertTrue($page->hasFrames()); $this->assertIdentical($page->getFrameset(), array(1 => new SimpleUrl('http://here/1.html'), 'A' => new SimpleUrl('http://here/2.html'), 'B' => new SimpleUrl('http://here/3.html'), 4 => new SimpleUrl('http://here/4.html'))); }