Exemplo n.º 1
0
 public function testCanFocusByName()
 {
     $page = new MockSimplePage();
     $frame1 = new MockSimplePage();
     $frame1->returnsByValue('getRaw', 'Stuff1');
     $frame1->returnsByValue('getFrameFocus', array());
     $frame2 = new MockSimplePage();
     $frame2->returnsByValue('getRaw', 'Stuff2');
     $frame2->returnsByValue('getFrameFocus', array());
     $frameset = new SimpleFrameset($page);
     $frameset->addFrame($frame1, 'A');
     $frameset->addFrame($frame2, 'B');
     $this->assertTrue($frameset->setFrameFocus('A'));
     $this->assertEqual($frameset->getFrameFocus(), array('A'));
     $this->assertEqual($frameset->getRaw(), 'Stuff1');
     $this->assertTrue($frameset->setFrameFocusByIndex(2));
     $this->assertEqual($frameset->getFrameFocus(), array('B'));
     $this->assertEqual($frameset->getRaw(), 'Stuff2');
     $this->assertFalse($frameset->setFrameFocus('z'));
     $frameset->clearFrameFocus();
     $this->assertEqual($frameset->getRaw(), 'Stuff1Stuff2');
 }