jQueryTestCase.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category ZendX
  16. * @package ZendX_JQuery
  17. * @subpackage View
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: DatePickerTest.php 20165 2010-01-09 18:57:56Z bkarwin $
  21. */
  22. require_once dirname(__FILE__)."/../../../TestHelper.php";
  23. require_once "Zend/Registry.php";
  24. require_once "Zend/View.php";
  25. require_once "ZendX/JQuery.php";
  26. require_once "ZendX/JQuery/View/Helper/JQuery.php";
  27. abstract class ZendX_JQuery_View_jQueryTestCase extends PHPUnit_Framework_TestCase
  28. {
  29. /**
  30. * @var Zend_View
  31. */
  32. protected $view = null;
  33. /**
  34. * @var ZendX_JQuery_View_Helper_JQuery_Container
  35. */
  36. protected $jquery = null;
  37. public function setUp()
  38. {
  39. Zend_Registry::_unsetInstance();
  40. $this->view = $this->getView();
  41. $this->jquery = new ZendX_JQuery_View_Helper_JQuery_Container();
  42. $this->jquery->setView($this->view);
  43. Zend_Registry::set('ZendX_JQuery_View_Helper_JQuery', $this->jquery);
  44. }
  45. public function tearDown()
  46. {
  47. ZendX_JQuery_View_Helper_JQuery::disableNoConflictMode();
  48. }
  49. /**
  50. * Get jQuery View
  51. *
  52. * @return Zend_View
  53. */
  54. public function getView()
  55. {
  56. require_once 'Zend/View.php';
  57. $view = new Zend_View();
  58. $view->addHelperPath('ZendX/JQuery/View/Helper/', 'ZendX_JQuery_View_Helper');
  59. return $view;
  60. }
  61. }