TestController.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. protected ?string $modelClass = 'Comments';
  23. /**
  24. * beforeFilter handler
  25. *
  26. * @return \Cake\Http\Response|null|void
  27. */
  28. public function beforeFilter(EventInterface $event)
  29. {
  30. }
  31. /**
  32. * index method
  33. *
  34. * @param mixed $testId
  35. * @param mixed $testTwoId
  36. * @return void
  37. */
  38. public function index($testId, $testTwoId): void
  39. {
  40. $this->request = $this->request->withParsedBody([
  41. 'testId' => $testId,
  42. 'test2Id' => $testTwoId,
  43. ]);
  44. }
  45. /**
  46. * view method
  47. *
  48. * @param mixed $testId
  49. * @param mixed $testTwoId
  50. * @return void
  51. */
  52. public function view($testId, $testTwoId): void
  53. {
  54. $this->request = $this->request->withParsedBody([
  55. 'testId' => $testId,
  56. 'test2Id' => $testTwoId,
  57. ]);
  58. }
  59. /**
  60. * @param mixed $passed
  61. */
  62. public function reflection($passed, Table $table)
  63. {
  64. }
  65. /**
  66. * @return \Cake\Http\Response
  67. */
  68. public function returner()
  69. {
  70. return $this->response->withStringBody('I am from the controller.');
  71. }
  72. /**
  73. * @return \Cake\Http\Response
  74. */
  75. public function willCauseException(): string
  76. {
  77. return '';
  78. }
  79. // phpcs:disable
  80. protected function protected_m()
  81. {
  82. }
  83. private function private_m()
  84. {
  85. }
  86. public function _hidden()
  87. {
  88. }
  89. // phpcs:enable
  90. public function admin_add(): void
  91. {
  92. }
  93. }