|
|
@@ -26,6 +26,7 @@ use Cake\TestSuite\TestCase;
|
|
|
use PHPUnit\Framework\Error\Notice;
|
|
|
use PHPUnit\Framework\Error\Warning;
|
|
|
use TestApp\Controller\Admin\PostsController;
|
|
|
+use TestApp\Controller\TestController;
|
|
|
use TestPlugin\Controller\TestPluginController;
|
|
|
|
|
|
/**
|
|
|
@@ -1052,165 +1053,3 @@ class ControllerTest extends TestCase
|
|
|
$this->assertTrue($controller->isAutoRenderEnabled());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-/**
|
|
|
- * AppController class
|
|
|
- */
|
|
|
-class ControllerTestAppController extends Controller
|
|
|
-{
|
|
|
- /**
|
|
|
- * modelClass property
|
|
|
- *
|
|
|
- * @var string
|
|
|
- */
|
|
|
- public $modelClass = 'Posts';
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * TestController class
|
|
|
- */
|
|
|
-class TestController extends ControllerTestAppController
|
|
|
-{
|
|
|
- /**
|
|
|
- * Theme property
|
|
|
- *
|
|
|
- * @var string
|
|
|
- */
|
|
|
- public $theme = 'Foo';
|
|
|
-
|
|
|
- /**
|
|
|
- * modelClass property
|
|
|
- *
|
|
|
- * @var string
|
|
|
- */
|
|
|
- public $modelClass = 'Comments';
|
|
|
-
|
|
|
- /**
|
|
|
- * beforeFilter handler
|
|
|
- *
|
|
|
- * @param \Cake\Event\EventInterface $event
|
|
|
- * @return \Cake\Http\Response|null
|
|
|
- */
|
|
|
- public function beforeFilter(EventInterface $event): ?Response
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * index method
|
|
|
- *
|
|
|
- * @param mixed $testId
|
|
|
- * @param mixed $testTwoId
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function index($testId, $testTwoId): void
|
|
|
- {
|
|
|
- $this->request = $this->request->withParsedBody([
|
|
|
- 'testId' => $testId,
|
|
|
- 'test2Id' => $testTwoId,
|
|
|
- ]);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * view method
|
|
|
- *
|
|
|
- * @param mixed $testId
|
|
|
- * @param mixed $testTwoId
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function view($testId, $testTwoId): void
|
|
|
- {
|
|
|
- $this->request = $this->request->withParsedBody([
|
|
|
- 'testId' => $testId,
|
|
|
- 'test2Id' => $testTwoId,
|
|
|
- ]);
|
|
|
- }
|
|
|
-
|
|
|
- public function returner()
|
|
|
- {
|
|
|
- return 'I am from the controller.';
|
|
|
- }
|
|
|
-
|
|
|
- // phpcs:disable
|
|
|
- protected function protected_m()
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- private function private_m()
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- public function _hidden()
|
|
|
- {
|
|
|
- }
|
|
|
- // phpcs:enable
|
|
|
-
|
|
|
- public function admin_add(): void
|
|
|
- {
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * TestComponent class
|
|
|
- */
|
|
|
-class TestComponent extends Component
|
|
|
-{
|
|
|
- /**
|
|
|
- * beforeRedirect method
|
|
|
- *
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function beforeRedirect(): void
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * initialize method
|
|
|
- *
|
|
|
- * @param array $config
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function initialize(array $config): void
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * startup method
|
|
|
- *
|
|
|
- * @param \Cake\Event\EventInterface $event
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function startup(EventInterface $event): void
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * shutdown method
|
|
|
- *
|
|
|
- * @param \Cake\Event\EventInterface $event
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function shutdown(EventInterface $event): void
|
|
|
- {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * beforeRender callback
|
|
|
- *
|
|
|
- * @param \Cake\Event\EventInterface $event
|
|
|
- * @return void
|
|
|
- */
|
|
|
- public function beforeRender(EventInterface $event): void
|
|
|
- {
|
|
|
- $controller = $event->getSubject();
|
|
|
- if ($this->viewclass) {
|
|
|
- $controller->viewClass = $this->viewclass;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * AnotherTestController class
|
|
|
- */
|
|
|
-class AnotherTestController extends ControllerTestAppController
|
|
|
-{
|
|
|
-}
|