2
0

HtmlQuicktimeTest.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // Call Zend_View_Helper_HtmlQuicktimeTest::main() if this source file is executed directly.
  3. if (!defined("PHPUnit_MAIN_METHOD")) {
  4. define("PHPUnit_MAIN_METHOD", "Zend_View_Helper_HtmlQuicktimeTest::main");
  5. }
  6. require_once dirname(__FILE__) . '/../../../TestHelper.php';
  7. require_once 'Zend/View.php';
  8. require_once 'Zend/View/Helper/HtmlQuicktime.php';
  9. class Zend_View_Helper_HtmlQuicktimeTest extends PHPUnit_Framework_TestCase
  10. {
  11. /**
  12. * @var Zend_View_Helper_HtmlQuicktime
  13. */
  14. public $helper;
  15. /**
  16. * Runs the test methods of this class.
  17. *
  18. * @access public
  19. * @static
  20. */
  21. public static function main()
  22. {
  23. require_once "PHPUnit/TextUI/TestRunner.php";
  24. $suite = new PHPUnit_Framework_TestSuite("Zend_View_Helper_HtmlQuicktimeTest");
  25. PHPUnit_TextUI_TestRunner::run($suite);
  26. }
  27. /**
  28. * Sets up the fixture, for example, open a network connection.
  29. * This method is called before a test is executed.
  30. *
  31. * @access protected
  32. */
  33. protected function setUp()
  34. {
  35. $this->view = new Zend_View();
  36. $this->helper = new Zend_View_Helper_HtmlQuicktime();
  37. $this->helper->setView($this->view);
  38. }
  39. public function tearDown()
  40. {
  41. unset($this->helper);
  42. }
  43. public function testMakeHtmlQuicktime()
  44. {
  45. $htmlQuicktime = $this->helper->htmlQuicktime('/path/to/quicktime.mov');
  46. $objectStartElement = '<object data="/path/to/quicktime.mov"'
  47. . ' type="video/quicktime"'
  48. . ' classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"'
  49. . ' codebase="http://www.apple.com/qtactivex/qtplugin.cab">';
  50. $this->assertContains($objectStartElement, $htmlQuicktime);
  51. $this->assertContains('</object>', $htmlQuicktime);
  52. }
  53. }
  54. // Call Zend_View_Helper_HtmlQuicktimeTest::main() if this source file is executed directly.
  55. if (PHPUnit_MAIN_METHOD == "Zend_View_Helper_HtmlQuicktimeTest::main") {
  56. Zend_View_Helper_HtmlQuicktimeTest::main();
  57. }