Beispiel #1
0
 public function testReadUrlsFromFrameInFocus()
 {
     $frame1 = new MockSimplePage();
     $frame1->returnsByValue('getUrls', array('a'));
     $frame1->returnsByValue('getUrlsByLabel', array(new SimpleUrl('l')));
     $frame1->returnsByValue('getUrlById', new SimpleUrl('i'));
     $frame2 = new MockSimplePage();
     $frame2->expectNever('getUrls');
     $frame2->expectNever('getUrlsByLabel');
     $frame2->expectNever('getUrlById');
     $frameset = new SimpleFrameset(new MockSimplePage());
     $frameset->addFrame($frame1, 'A');
     $frameset->addFrame($frame2, 'B');
     $frameset->setFrameFocus('A');
     $this->assertIdentical($frameset->getUrls(), array('a'));
     $expected = new SimpleUrl('l');
     $expected->setTarget('A');
     $this->assertIdentical($frameset->getUrlsByLabel('label'), array($expected));
     $expected = new SimpleUrl('i');
     $expected->setTarget('A');
     $this->assertIdentical($frameset->getUrlById(99), $expected);
 }