You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB

  1. <?php
  2. /*
  3. * @copyright NetMonsters <team@netmonsters.ru>
  4. * @link http://netmonsters.ru
  5. * @package Majestic
  6. * @subpackage UnitTests
  7. * @since 2011-10-11
  8. *
  9. * Unit tests for PHPView class
  10. */
  11. require_once dirname(__FILE__) . '/../../../Registry.php';
  12. require_once dirname(__FILE__) . '/../../../view/helpers/ViewHelper.php';
  13. require_once dirname(__FILE__) . '/../../../view/helpers/HeadViewHelper.php';
  14. class HeadViewHelperTest extends PHPUnit_Framework_TestCase
  15. {
  16. public $helper;
  17. public function setUp()
  18. {
  19. Registry::set('HeadViewHelper', array());
  20. $this->helper = new HeadViewHelper(null);
  21. }
  22. public function testHead()
  23. {
  24. $this->helper->head('<meta />');
  25. $result = Registry::get('HeadViewHelper');
  26. $this->assertSame(array('<meta />'), Registry::get('HeadViewHelper'));
  27. $this->helper->head('<link />');
  28. $this->assertSame(array('<meta />', '<link />'), Registry::get('HeadViewHelper'));
  29. }
  30. public function testToString()
  31. {
  32. $this->helper->head('<meta />');
  33. $this->helper->head('<link />');
  34. $result = $this->helper->__toString();
  35. $this->assertSame("<meta />\n <link />\n", $result);
  36. }
  37. }