TestController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\Controller;
  4. use Cake\Event\EventInterface;
  5. use Cake\ORM\Table;
  6. /**
  7. * TestController class
  8. */
  9. class TestController extends ControllerTestAppController
  10. {
  11. /**
  12. * Theme property
  13. *
  14. * @var string
  15. */
  16. public $theme = 'Foo';
  17. /**
  18. * modelClass property
  19. *
  20. * @var string
  21. */
  22. public $modelClass = 'Comments';
  23. /**
  24. * beforeFilter handler
  25. *
  26. * @param \Cake\Event\EventInterface $event
  27. * @return \Cake\Http\Response|null
  28. */
  29. public function beforeFilter(EventInterface $event): ?Response
  30. {
  31. }
  32. /**
  33. * index method
  34. *
  35. * @param mixed $testId
  36. * @param mixed $testTwoId
  37. * @return void
  38. */
  39. public function index($testId, $testTwoId): void
  40. {
  41. $this->request = $this->request->withParsedBody([
  42. 'testId' => $testId,
  43. 'test2Id' => $testTwoId,
  44. ]);
  45. }
  46. /**
  47. * view method
  48. *
  49. * @param mixed $testId
  50. * @param mixed $testTwoId
  51. * @return void
  52. */
  53. public function view($testId, $testTwoId): void
  54. {
  55. $this->request = $this->request->withParsedBody([
  56. 'testId' => $testId,
  57. 'test2Id' => $testTwoId,
  58. ]);
  59. }
  60. public function reflection($passed, Table $table)
  61. {
  62. }
  63. public function returner()
  64. {
  65. return $this->response->withStringBody('I am from the controller.');
  66. }
  67. public function willCauseException()
  68. {
  69. return '';
  70. }
  71. // phpcs:disable
  72. protected function protected_m()
  73. {
  74. }
  75. private function private_m()
  76. {
  77. }
  78. public function _hidden()
  79. {
  80. }
  81. // phpcs:enable
  82. public function admin_add(): void
  83. {
  84. }
  85. }