IndexController.php 2.5 KB

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