view = new Zend_View(); $this->helper = new Zend_View_Helper_FormImage(); $this->helper->setView($this->view); } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } public function testFormImageRendersFormImageXhtml() { $button = $this->helper->formImage('foo', 'bar'); $this->assertRegexp('/]*?src="bar"/', $button); $this->assertRegexp('/]*?name="foo"/', $button); $this->assertRegexp('/]*?type="image"/', $button); } public function testDisablingFormImageRendersImageInputWithDisableAttribute() { $button = $this->helper->formImage('foo', 'bar', array('disable' => true)); $this->assertRegexp('/]*?disabled="disabled"/', $button); $this->assertRegexp('/]*?src="bar"/', $button); $this->assertRegexp('/]*?name="foo"/', $button); $this->assertRegexp('/]*?type="image"/', $button); } } // Call Zend_View_Helper_FormImageTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "Zend_View_Helper_FormImageTest::main") { Zend_View_Helper_FormImageTest::main(); }