view = $this->getView();
$this->helper = new Zend_Dojo_View_Helper_ContentPane();
$this->helper->setView($this->view);
}
/**
* Tears down the fixture, for example, close a network connection.
* This method is called after a test is executed.
*
* @return void
*/
public function tearDown()
{
}
public function getView()
{
require_once 'Zend/View.php';
$view = new Zend_View();
$view->addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
return $view;
}
public function getContainer()
{
return $this->view->contentPane('pane1', 'This is the pane content', array('title' => 'Pane 1'));
}
public function testShouldAllowDeclarativeDijitCreation()
{
$html = $this->getContainer();
$this->assertRegexp('/
]*(dojoType="dijit.layout.ContentPane")/', $html, $html);
}
public function testShouldAllowProgrammaticDijitCreation()
{
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
$html = $this->getContainer();
$this->assertNotRegexp('/
]*(dojoType="dijit.layout.ContentPane")/', $html);
$this->assertNotNull($this->view->dojo()->getDijit('pane1'));
}
/**
* @group ZF-3877
*/
public function testContentPaneMarkupShouldNotContainNameAttribute()
{
$html = $this->view->contentPane('pane1', 'This is the pane content', array('id' => 'pane', 'title' => 'Pane 1'));
$this->assertNotContains('name="/', $html, $html);
Zend_Dojo_View_Helper_Dojo::setUseProgrammatic();
$html = $this->view->contentPane('pane1', 'This is the pane content', array('id' => 'pane', 'title' => 'Pane 1'));
$this->assertNotContains('name="/', $html, $html);
}
/**
* @group ZF-4522
*/
public function testCaptureStartShouldReturnVoid()
{
$test = $this->view->contentPane()->captureStart('pane1');
$this->view->contentPane()->captureEnd('pane1');
$this->assertNull($test);
}
}
// Call Zend_Dojo_View_Helper_ContentPaneTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "Zend_Dojo_View_Helper_ContentPaneTest::main") {
Zend_Dojo_View_Helper_ContentPaneTest::main();
}