Exemplo n.º 1
0
 public function testAddCrumb()
 {
     $this->assertEmpty($this->_block->toHtml());
     $info = array('label' => 'test label', 'title' => 'test title', 'link' => 'test link');
     $this->_block->addCrumb('test', $info);
     $html = $this->_block->toHtml();
     $this->assertContains('test label', $html);
     $this->assertContains('test title', $html);
     $this->assertContains('test link', $html);
 }
Exemplo n.º 2
0
 public function testGetCacheKeyInfo()
 {
     $crumbs = array('test' => array('label' => 'test label', 'title' => 'test title', 'link' => 'test link'));
     foreach ($crumbs as $crumbName => &$crumb) {
         $this->_block->addCrumb($crumbName, $crumb);
         $crumb += array('first' => null, 'last' => null, 'readonly' => null);
     }
     $cacheKeyInfo = $this->_block->getCacheKeyInfo();
     $crumbsFromCacheKey = unserialize(base64_decode($cacheKeyInfo['crumbs']));
     $this->assertEquals($crumbs, $crumbsFromCacheKey);
 }