function testDefaultFrameTargetOnForm() { $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php', 'id' => '33')); $form = new SimpleForm($tag, new SimpleUrl('http://host/a/index.html')); $form->setDefaultTarget('frame'); $expected = new SimpleUrl('http://host/a/here.php'); $expected->setTarget('frame'); $this->assertEqual($form->getAction(), $expected); }
function testDefaultFrameTargetOnForm() { $page = new MockSimplePage(); $page->expectOnce('expandUrl', array(new SimpleUrl('here.php'))); $page->setReturnValue('expandUrl', new SimpleUrl('http://host/here.php')); $tag = new SimpleFormTag(array('method' => 'GET', 'action' => 'here.php')); $form = new SimpleForm($tag, $page); $form->setDefaultTarget('frame'); $expected = new SimpleUrl('http://host/here.php'); $expected->setTarget('frame'); $this->assertEqual($form->getAction(), $expected); }