NamespaceTest.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 Zend
  16. * @package Zend_Controller
  17. * @subpackage UnitTests
  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:$
  21. */
  22. if (!defined('PHPUnit_MAIN_METHOD')) {
  23. require_once dirname(__FILE__) . '/../../../../TestHelper.php';
  24. define('PHPUnit_MAIN_METHOD', 'Zend_Controller_Action_Helper_NamespaceTest::main');
  25. }
  26. /**
  27. * Test class for Zend_Controller_Action_Helper_Abstract.
  28. *
  29. * @category Zend
  30. * @package Zend_Controller
  31. * @subpackage UnitTests
  32. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  33. * @license http://framework.zend.com/license/new-bsd New BSD License
  34. * @group Zend_Controller
  35. * @group Zend_Controller_Action
  36. * @group Zend_Controller_Action_Helper
  37. */
  38. class Zend_Controller_Action_Helper_NamespaceTest extends PHPUnit_Framework_TestCase
  39. {
  40. /**
  41. * Runs the test methods of this class.
  42. *
  43. * @return void
  44. */
  45. public static function main()
  46. {
  47. $suite = new PHPUnit_Framework_TestSuite('Zend_Controller_Action_Helper_NamespaceTest');
  48. $result = PHPUnit_TextUI_TestRunner::run($suite);
  49. }
  50. /**
  51. * @group ZF-10158
  52. */
  53. public function testGetNameWithNamespace()
  54. {
  55. require_once dirname(__FILE__) . '/../../_files/Helpers/NamespacedHelper.php';
  56. $helper = new MyApp\Controller\Action\Helper\NamespacedHelper;
  57. $this->assertEquals('NamespacedHelper', $helper->getName());
  58. }
  59. }
  60. // Call Zend_Controller_Action_Helper_NamespaceTest::main() if this source file is executed directly.
  61. if (PHPUnit_MAIN_METHOD == 'Zend_Controller_Action_Helper_NamespaceTest::main') {
  62. Zend_Controller_Action_Helper_NamespaceTest::main();
  63. }