IndexController.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. require_once 'PHPUnit/Util/Filter.php';
  23. PHPUnit_Util_Filter::addFileToFilter(__FILE__);
  24. require_once 'Zend/Controller/Action.php';
  25. /**
  26. * Mock file for testbed
  27. *
  28. * @category Zend
  29. * @package Zend_Controller
  30. * @subpackage UnitTests
  31. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. class IndexController extends Zend_Controller_Action
  35. {
  36. /**
  37. * Test Function for indexAction
  38. *
  39. * @return void
  40. */
  41. public function indexAction()
  42. {
  43. $this->_response->appendBody("Index action called\n");
  44. }
  45. /**
  46. * Test Function for prefixAction
  47. *
  48. * @return void
  49. */
  50. public function prefixAction()
  51. {
  52. $this->_response->appendBody("Prefix action called\n");
  53. }
  54. /**
  55. * Test Function for argsAction
  56. *
  57. * @return void
  58. */
  59. public function argsAction()
  60. {
  61. $args = '';
  62. foreach ($this->getInvokeArgs() as $key => $value) {
  63. $args .= $key . ': ' . $value . '; ';
  64. }
  65. $this->_response->appendBody('Args action called with params ' . $args . "\n");
  66. }
  67. /**
  68. * Test Function for replaceAction
  69. *
  70. * @return void
  71. */
  72. public function replaceAction()
  73. {
  74. $request = new Zend_Controller_Request_Http();
  75. $request->setControllerName('index')
  76. ->setActionName('reset')
  77. ->setDispatched(false);
  78. $response = new Zend_Controller_Response_Http();
  79. $front = Zend_Controller_Front::getInstance();
  80. $front->setRequest($request)
  81. ->setResponse($response);
  82. }
  83. /**
  84. * Test Function for resetAction
  85. *
  86. * @return void
  87. */
  88. public function resetAction()
  89. {
  90. $this->_response->appendBody('Reset action called');
  91. }
  92. }