Html->tag('div', 'text');
$this->assertTags($result, '
Html->tag('div', '', 'class-name');
$this->assertTags($result, array('div' => array('class' => 'class-name'), 'preg://', '/div'));
$result = $this->Html->tag('div', '', array('class' => 'class-name', 'escape' => true));
$this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div'));
}
/**
* testDiv method
*
* @access public
* @return void
*/
function testDiv() {
$result = $this->Html->div('class-name');
$this->assertTags($result, array('div' => array('class' => 'class-name')));
$result = $this->Html->div('class-name', 'text');
$this->assertTags($result, array('div' => array('class' => 'class-name'), 'text', '/div'));
$result = $this->Html->div('class-name', '', array('escape' => true));
$this->assertTags($result, array('div' => array('class' => 'class-name'), '<text>', '/div'));
}
/**
* testPara method
*
* @access public
* @return void
*/
function testPara() {
$result = $this->Html->para('class-name', '');
$this->assertTags($result, array('p' => array('class' => 'class-name')));
$result = $this->Html->para('class-name', 'text');
$this->assertTags($result, array('p' => array('class' => 'class-name'), 'text', '/p'));
$result = $this->Html->para('class-name', '', array('escape' => true));
$this->assertTags($result, array('p' => array('class' => 'class-name'), '<text>', '/p'));
}
/**
* testCrumbList method
*
* @access public
*
* @return void
*/
function testCrumbList() {
$this->Html->addCrumb('Home', '/', array('class' => 'home'));
$this->Html->addCrumb('Some page', '/some_page');
$this->Html->addCrumb('Another page');
$result = $this->Html->getCrumbList(
array('class' => 'breadcrumbs')
);
$this->assertTags(
$result,
array(
array('ul' => array('class' => 'breadcrumbs')),
array('li' => array('class' => 'first')),
array('a' => array('class' => 'home', 'href' => '/')), 'Home', '/a',
'/li',
' array('href' => '/some_page')), 'Some page', '/a',
'/li',
array('li' => array('class' => 'last')),
'Another page',
'/li',
'/ul'
)
);
}
}