|
|
@ -17,6 +17,9 @@ require_once dirname(__FILE__) . '/../../../view/helpers/BreadcrumbViewHelper.ph |
|
|
|
class BreadcrumbViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
|
{ |
|
|
|
|
|
|
|
/** |
|
|
|
* @var BreadcrumbViewHelper |
|
|
|
*/ |
|
|
|
public $helper; |
|
|
|
|
|
|
|
public function setUp() |
|
|
@ -43,7 +46,7 @@ class BreadcrumbViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->helper->prepend('Home page', 'home.php'); |
|
|
|
$this->helper->breadcrumb('Guest page', 'guest.php'); |
|
|
|
$this->helper->append('Leave message', 'feedback.php'); |
|
|
|
$this->assertSame(array('Home page' => 'home.php', 'Guest page' => 'guest.php', 'Leave message'=> 'feedback.php'), Registry::get('BreadcrumbViewHelper')); |
|
|
|
$this->assertSame(array('Home page' => 'home.php', 'Guest page' => 'guest.php', 'Leave message' => 'feedback.php'), Registry::get('BreadcrumbViewHelper')); |
|
|
|
|
|
|
|
$result = $this->helper->__toString(); |
|
|
|
$this->assertSame('<a href="home.php">Home page</a> > <a href="guest.php">Guest page</a> > <a href="feedback.php">Leave message</a>', $result); |
|
|
@ -55,6 +58,5 @@ class BreadcrumbViewHelperTest extends PHPUnit_Framework_TestCase |
|
|
|
$this->helper->append('Last page', ''); |
|
|
|
$result = $this->helper->__toString(); |
|
|
|
$this->assertSame('<a href="home.php">Home page</a>-<a href="guest.php">Guest page</a>-<a href="feedback.php">Leave message</a>-Last page', $result); |
|
|
|
|
|
|
|
} |
|
|
|
} |