view = new Zend_View();
$this->helper = new Zend_View_Helper_FormFile();
$this->helper->setView($this->view);
}
/**
* ZF-1666
*/
public function testCanDisableElement()
{
$html = $this->helper->formFile(array(
'name' => 'foo',
'attribs' => array('disable' => true)
));
$this->assertRegexp('/]*?(disabled="disabled")/', $html);
}
/**
* ZF-1666
*/
public function testDisablingElementDoesNotRenderHiddenElements()
{
$html = $this->helper->formFile(array(
'name' => 'foo',
'attribs' => array('disable' => true)
));
$this->assertNotRegexp('/]*?(type="hidden")/', $html);
}
public function testRendersAsHtmlByDefault()
{
$test = $this->helper->formFile(array(
'name' => 'foo',
));
$this->assertNotContains(' />', $test);
}
public function testCanRendersAsXHtml()
{
$this->view->doctype('XHTML1_STRICT');
$test = $this->helper->formFile(array(
'name' => 'foo',
));
$this->assertContains(' />', $test);
}
}
// Call Zend_View_Helper_FormFileTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_View_Helper_FormFileTest::main") {
Zend_View_Helper_FormFileTest::main();
}