diff --git a/src/Error/ExceptionRenderer.php b/src/Error/ExceptionRenderer.php index 6b71136f6f8..95307c8a2ea 100644 --- a/src/Error/ExceptionRenderer.php +++ b/src/Error/ExceptionRenderer.php @@ -95,6 +95,7 @@ public function __construct(Exception $exception) { * a bare controller will be used. * * @return \Cake\Controller\Controller + * @triggers Controller.startup $controller */ protected function _getController() { if (!$request = Router::getRequest(true)) { diff --git a/src/Event/EventManager.php b/src/Event/EventManager.php index 831befa43c5..0d0966d681a 100644 --- a/src/Event/EventManager.php +++ b/src/Event/EventManager.php @@ -215,6 +215,7 @@ protected function _detachSubscriber(EventListenerInterface $subscriber, $eventK * * @param string|\Cake\Event\Event $event the event key name or instance of Event * @return \Cake\Event\Event + * @triggers $event */ public function dispatch($event) { if (is_string($event)) { diff --git a/src/Shell/Task/TemplateTask.php b/src/Shell/Task/TemplateTask.php index 6e81ea4ea0f..d358f2ef7a0 100644 --- a/src/Shell/Task/TemplateTask.php +++ b/src/Shell/Task/TemplateTask.php @@ -48,6 +48,7 @@ class TemplateTask extends Shell { * Get view instance * * @return \Cake\View\View + * @triggers Bake.initialize $view */ public function getView() { if ($this->View) { diff --git a/tests/TestCase/Controller/Component/AuthComponentTest.php b/tests/TestCase/Controller/Component/AuthComponentTest.php index 761634d09c9..7269e4e2b3c 100644 --- a/tests/TestCase/Controller/Component/AuthComponentTest.php +++ b/tests/TestCase/Controller/Component/AuthComponentTest.php @@ -103,6 +103,7 @@ public function testNoAuth() { * testIsErrorOrTests * * @return void + * @triggers Controller.startup $this->Controller */ public function testIsErrorOrTests() { $event = new Event('Controller.startup', $this->Controller); @@ -159,6 +160,7 @@ public function testIdentify() { * testRedirectVarClearing method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRedirectVarClearing() { $this->Controller->request['controller'] = 'auth_test'; @@ -180,6 +182,7 @@ public function testRedirectVarClearing() { * testAuthorizeFalse method * * @return void + * @triggers Controller.startup $this->Controller */ public function testAuthorizeFalse() { $event = new Event('Controller.startup', $this->Controller); @@ -374,6 +377,7 @@ public function testSameAuthenticateWithDifferentHashers() { * Tests that deny always takes precedence over allow * * @return void + * @triggers Controller.startup $this->Controller */ public function testAllowDenyAll() { $event = new Event('Controller.startup', $this->Controller); @@ -433,6 +437,7 @@ public function testAllowDenyAll() { * test that deny() converts camel case inputs to lowercase. * * @return void + * @triggers Controller.startup $this->Controller */ public function testDenyWithCamelCaseMethods() { $event = new Event('Controller.startup', $this->Controller); @@ -455,6 +460,7 @@ public function testDenyWithCamelCaseMethods() { * test that allow() and allowedActions work with camelCase method names. * * @return void + * @triggers Controller.startup $this->Controller */ public function testAllowedActionsWithCamelCaseMethods() { $event = new Event('Controller.startup', $this->Controller); @@ -507,6 +513,7 @@ public function testAllowedActionsSetWithAllowMethod() { * testLoginRedirect method * * @return void + * @triggers Controller.startup $this->Controller */ public function testLoginRedirect() { $url = '/auth_test/camelCase'; @@ -652,6 +659,7 @@ public function testLoginRedirect() { * testNoLoginRedirectForAuthenticatedUser method * * @return void + * @triggers Controller.startup $this->Controller */ public function testNoLoginRedirectForAuthenticatedUser() { $this->Controller->request['controller'] = 'auth_test'; @@ -678,6 +686,7 @@ public function testNoLoginRedirectForAuthenticatedUser() { * Default to loginRedirect, if set, on authError. * * @return void + * @triggers Controller.startup $Controller */ public function testDefaultToLoginRedirect() { $url = '/party/on'; @@ -709,6 +718,7 @@ public function testDefaultToLoginRedirect() { * testRedirectToUnauthorizedRedirect * * @return void + * @triggers Controller.startup $Controller */ public function testRedirectToUnauthorizedRedirect() { $url = '/party/on'; @@ -750,6 +760,7 @@ public function testRedirectToUnauthorizedRedirect() { * testRedirectToUnauthorizedRedirectSuppressedAuthError * * @return void + * @triggers Controller.startup $Controller */ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() { $url = '/party/on'; @@ -788,6 +799,7 @@ public function testRedirectToUnauthorizedRedirectSuppressedAuthError() { * * @expectedException \Cake\Network\Exception\ForbiddenException * @return void + * @triggers Controller.startup $Controller */ public function testForbiddenException() { $url = '/party/on'; @@ -814,6 +826,7 @@ public function testForbiddenException() { * Test that no redirects or authorization tests occur on the loginAction * * @return void + * @triggers Controller.startup $this->Controller */ public function testNoRedirectOnLoginAction() { $event = new Event('Controller.startup', $this->Controller); @@ -839,6 +852,7 @@ public function testNoRedirectOnLoginAction() { * And the user doesn't have a session. * * @return void + * @triggers Controller.startup $this->Controller */ public function testNoRedirectOn404() { $event = new Event('Controller.startup', $this->Controller); @@ -852,6 +866,7 @@ public function testNoRedirectOn404() { * testAdminRoute method * * @return void + * @triggers Controller.startup $this->Controller */ public function testAdminRoute() { $event = new Event('Controller.startup', $this->Controller); @@ -884,6 +899,7 @@ public function testAdminRoute() { * testAjaxLogin method * * @return void + * @triggers Controller.startup $this->Controller */ public function testAjaxLogin() { $this->Controller->request = new Request([ @@ -910,6 +926,7 @@ public function testAjaxLogin() { * testLoginActionRedirect method * * @return void + * @triggers Controller.startup $this->Controller */ public function testLoginActionRedirect() { $event = new Event('Controller.startup', $this->Controller); @@ -952,6 +969,7 @@ public function testLoginActionRedirect() { * accessed by $this->user(). * * @return void + * @triggers Controller.startup $this->Controller */ public function testStatelessAuthWorksWithUser() { $event = new Event('Controller.startup', $this->Controller); @@ -1077,6 +1095,7 @@ public function testGettingUserAfterSetUser() { * test flash settings. * * @return void + * @triggers Controller.startup $this->Controller) */ public function testFlashSettings() { $this->Auth->Flash = $this->getMock( @@ -1261,6 +1280,7 @@ public function testUser() { * @expectedException \Cake\Network\Exception\UnauthorizedException * @expectedExceptionCode 401 * @return void + * @triggers Controller.startup $this->Controller */ public function testStatelessAuthNoRedirect() { $event = new Event('Controller.startup', $this->Controller); @@ -1277,6 +1297,7 @@ public function testStatelessAuthNoRedirect() { * testStatelessAuthRedirect method * * @return void + * @triggers Controller.startup $this->Controller */ public function testStatelessFollowedByStatefulAuth() { $event = new Event('Controller.startup', $this->Controller); diff --git a/tests/TestCase/Controller/Component/CsrfComponentTest.php b/tests/TestCase/Controller/Component/CsrfComponentTest.php index d1e4b16515a..7b71bfe2655 100644 --- a/tests/TestCase/Controller/Component/CsrfComponentTest.php +++ b/tests/TestCase/Controller/Component/CsrfComponentTest.php @@ -53,6 +53,7 @@ public function tearDown() { * Test setting the cookie value * * @return void + * @triggers Controller.startup $controller */ public function testSettingCookie() { $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -89,6 +90,7 @@ public static function httpMethodProvider() { * * @dataProvider httpMethodProvider * @return void + * @triggers Controller.startup $controller */ public function testValidTokenInHeader($method) { $_SERVER['REQUEST_METHOD'] = $method; @@ -109,6 +111,7 @@ public function testValidTokenInHeader($method) { * @dataProvider httpMethodProvider * @expectedException \Cake\Network\Exception\ForbiddenException * @return void + * @triggers Controller.startup $controller */ public function testInvalidTokenInHeader($method) { $_SERVER['REQUEST_METHOD'] = $method; @@ -129,6 +132,7 @@ public function testInvalidTokenInHeader($method) { * * @dataProvider httpMethodProvider * @return void + * @triggers Controller.startup $controller */ public function testValidTokenRequestData($method) { $_SERVER['REQUEST_METHOD'] = $method; @@ -151,6 +155,7 @@ public function testValidTokenRequestData($method) { * @dataProvider httpMethodProvider * @expectedException \Cake\Network\Exception\ForbiddenException * @return void + * @triggers Controller.startup $controller */ public function testInvalidTokenRequestData($method) { $_SERVER['REQUEST_METHOD'] = $method; @@ -170,6 +175,7 @@ public function testInvalidTokenRequestData($method) { * Test that CSRF checks are not applied to request action requests. * * @return void + * @triggers Controller.startup $controller */ public function testCsrfValidationSkipsRequestAction() { $_SERVER['REQUEST_METHOD'] = 'POST'; @@ -192,6 +198,7 @@ public function testCsrfValidationSkipsRequestAction() { * Test that the configuration options work. * * @return void + * @triggers Controller.startup $controller */ public function testConfigurationCookieCreate() { $_SERVER['REQUEST_METHOD'] = 'GET'; @@ -222,6 +229,7 @@ public function testConfigurationCookieCreate() { * Test that the configuration options work. * * @return void + * @triggers Controller.startup $controller */ public function testConfigurationValidate() { $_SERVER['REQUEST_METHOD'] = 'POST'; diff --git a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php index 48f198a7c94..b435da72ac8 100644 --- a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php +++ b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php @@ -314,6 +314,7 @@ public function testViewClassMap() { * Verify that isAjax is set on the request params for ajax requests * * @return void + * @triggers Controller.startup $this->Controller */ public function testIsAjaxParams() { $this->request->env('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest'); @@ -328,6 +329,7 @@ public function testIsAjaxParams() { * testAutoAjaxLayout method * * @return void + * @triggers Controller.startup $this->Controller */ public function testAutoAjaxLayout() { $event = new Event('Controller.startup', $this->Controller); @@ -349,6 +351,7 @@ public function testAutoAjaxLayout() { * test custom JsonView class is loaded and correct. * * @return void + * @triggers Controller.startup $this->Controller */ public function testJsonViewLoaded() { Router::extensions(['json', 'xml', 'ajax'], false); @@ -366,6 +369,7 @@ public function testJsonViewLoaded() { * test custom XmlView class is loaded and correct. * * @return void + * @triggers Controller.startup $this->Controller */ public function testXmlViewLoaded() { Router::extensions(['json', 'xml', 'ajax'], false); @@ -383,6 +387,7 @@ public function testXmlViewLoaded() { * test custom AjaxView class is loaded and correct. * * @return void + * @triggers Controller.startup $this->Controller */ public function testAjaxViewLoaded() { Router::extensions(['json', 'xml', 'ajax'], false); @@ -399,6 +404,7 @@ public function testAjaxViewLoaded() { * test configured extension but no view class set. * * @return void + * @triggers Controller.startup $this->Controller */ public function testNoViewClassExtension() { Router::extensions(['json', 'xml', 'ajax', 'csv'], false); @@ -414,6 +420,7 @@ public function testNoViewClassExtension() { * testStartupCallback method * * @return void + * @triggers Controller.startup $this->Controller */ public function testStartupCallback() { $event = new Event('Controller.startup', $this->Controller); @@ -429,6 +436,7 @@ public function testStartupCallback() { * testStartupCallback with charset. * * @return void + * @triggers Controller.startup $this->Controller */ public function testStartupCallbackCharset() { $event = new Event('Controller.startup', $this->Controller); @@ -444,6 +452,7 @@ public function testStartupCallbackCharset() { * Test mapping a new type and having startup process it. * * @return void + * @triggers Controller.startup $this->Controller */ public function testStartupCustomTypeProcess() { if (!function_exists('str_getcsv')) { @@ -468,6 +477,7 @@ public function testStartupCustomTypeProcess() { * testNonAjaxRedirect method * * @return void + * @triggers Controller.startup $this->Controller */ public function testNonAjaxRedirect() { $event = new Event('Controller.startup', $this->Controller); @@ -480,6 +490,7 @@ public function testNonAjaxRedirect() { * test that redirects with ajax and no URL don't do anything. * * @return void + * @triggers Controller.startup $this->Controller */ public function testAjaxRedirectWithNoUrl() { $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; @@ -746,6 +757,7 @@ public function testPrefers() { * test that ajax requests involving redirects trigger requestAction instead. * * @return void + * @triggers Controller.beforeRedirect $this->Controller */ public function testAjaxRedirectAsRequestAction() { Configure::write('App.namespace', 'TestApp'); @@ -775,6 +787,7 @@ public function testAjaxRedirectAsRequestAction() { * this would cause the ajax layout to not be rendered. * * @return void + * @triggers Controller.beforeRedirect $this->Controller */ public function testAjaxRedirectAsRequestActionStillRenderingLayout() { Configure::write('App.namespace', 'TestApp'); @@ -807,6 +820,7 @@ public function testAjaxRedirectAsRequestActionStillRenderingLayout() { * * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 * @return void + * @triggers Controller.beforeRender $this->Controller */ public function testBeforeRedirectCallbackWithArrayUrl() { Configure::write('App.namespace', 'TestApp'); @@ -847,6 +861,7 @@ public function testAddInputTypeException() { * Test checkNotModified method * * @return void + * @triggers Controller.beforeRender $this->Controller */ public function testCheckNotModifiedByEtagStar() { $_SERVER['HTTP_IF_NONE_MATCH'] = '*'; @@ -862,6 +877,7 @@ public function testCheckNotModifiedByEtagStar() { * Test checkNotModified method * * @return void + * @triggers Controller.beforeRender */ public function testCheckNotModifiedByEtagExact() { $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; @@ -877,6 +893,7 @@ public function testCheckNotModifiedByEtagExact() { * Test checkNotModified method * * @return void + * @triggers Controller.beforeRender $this->Controller */ public function testCheckNotModifiedByEtagAndTime() { $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; @@ -894,6 +911,7 @@ public function testCheckNotModifiedByEtagAndTime() { * Test checkNotModified method * * @return void + * @triggers Controller.beforeRender $this->Controller */ public function testCheckNotModifiedNoInfo() { $event = new Event('Controller.beforeRender', $this->Controller); diff --git a/tests/TestCase/Controller/Component/SecurityComponentTest.php b/tests/TestCase/Controller/Component/SecurityComponentTest.php index 59e93d87d34..059aaa7321b 100644 --- a/tests/TestCase/Controller/Component/SecurityComponentTest.php +++ b/tests/TestCase/Controller/Component/SecurityComponentTest.php @@ -166,6 +166,7 @@ public function tearDown() { * * @expectedException \Cake\Network\Exception\BadRequestException * @return void + * @triggers Controller.startup $Controller, $this->Controller */ public function testBlackholeWithBrokenCallback() { $request = new Request([ @@ -189,6 +190,7 @@ public function testBlackholeWithBrokenCallback() { * action results in an exception. * * @return void + * @triggers Controller.startup $this->Controller */ public function testExceptionWhenActionIsBlackholeCallback() { $this->Controller->request->addParams(array( @@ -219,6 +221,7 @@ public function testConstructorSettingProperties() { * testStartup method * * @return void + * @triggers Controller.startup $this->Controller */ public function testStartup() { $event = new Event('Controller.startup', $this->Controller); @@ -230,6 +233,7 @@ public function testStartup() { * testRequireSecureFail method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireSecureFail() { $_SERVER['HTTPS'] = 'off'; @@ -245,6 +249,7 @@ public function testRequireSecureFail() { * testRequireSecureSucceed method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireSecureSucceed() { $_SERVER['HTTPS'] = 'on'; @@ -260,6 +265,7 @@ public function testRequireSecureSucceed() { * testRequireSecureEmptyFail method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireSecureEmptyFail() { $_SERVER['HTTPS'] = 'off'; @@ -275,6 +281,7 @@ public function testRequireSecureEmptyFail() { * testRequireSecureEmptySucceed method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireSecureEmptySucceed() { $_SERVER['HTTPS'] = 'on'; @@ -290,6 +297,7 @@ public function testRequireSecureEmptySucceed() { * testRequireAuthFail method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireAuthFail() { $event = new Event('Controller.startup', $this->Controller); @@ -321,6 +329,7 @@ public function testRequireAuthFail() { * testRequireAuthSucceed method * * @return void + * @triggers Controller.startup $this->Controller */ public function testRequireAuthSucceed() { $_SERVER['REQUEST_METHOD'] = 'AUTH'; @@ -349,6 +358,7 @@ public function testRequireAuthSucceed() { * Simple hash validation test * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePost() { $event = new Event('Controller.startup', $this->Controller); @@ -368,6 +378,7 @@ public function testValidatePost() { * Test that validatePost fails if you are missing the session information. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostNoSession() { $event = new Event('Controller.startup', $this->Controller); @@ -387,6 +398,7 @@ public function testValidatePostNoSession() { * test that validatePost fails if any of its required fields are missing. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostFormHacking() { $event = new Event('Controller.startup', $this->Controller); @@ -406,6 +418,7 @@ public function testValidatePostFormHacking() { * attacks. Thanks to Felix Wilhelm * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostObjectDeserialize() { $event = new Event('Controller.startup', $this->Controller); @@ -429,6 +442,7 @@ public function testValidatePostObjectDeserialize() { * Tests validation post data ignores `_csrfToken`. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostIgnoresCsrfToken() { $event = new Event('Controller.startup', $this->Controller); @@ -449,6 +463,7 @@ public function testValidatePostIgnoresCsrfToken() { * Tests validation of checkbox arrays * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostArray() { $event = new Event('Controller.startup', $this->Controller); @@ -468,6 +483,7 @@ public function testValidatePostArray() { * testValidatePostNoModel method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostNoModel() { $event = new Event('Controller.startup', $this->Controller); @@ -489,6 +505,7 @@ public function testValidatePostNoModel() { * testValidatePostSimple method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostSimple() { $event = new Event('Controller.startup', $this->Controller); @@ -510,6 +527,7 @@ public function testValidatePostSimple() { * Tests hash validation for multiple records, including locked fields * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostComplex() { $event = new Event('Controller.startup', $this->Controller); @@ -539,6 +557,7 @@ public function testValidatePostComplex() { * test ValidatePost with multiple select elements. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostMultipleSelect() { $event = new Event('Controller.startup', $this->Controller); @@ -585,6 +604,7 @@ public function testValidatePostMultipleSelect() { * Second block tests checked checkbox * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostCheckbox() { $event = new Event('Controller.startup', $this->Controller); @@ -626,6 +646,7 @@ public function testValidatePostCheckbox() { * testValidatePostHidden method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostHidden() { $event = new Event('Controller.startup', $this->Controller); @@ -648,6 +669,7 @@ public function testValidatePostHidden() { * testValidatePostWithDisabledFields method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostWithDisabledFields() { $event = new Event('Controller.startup', $this->Controller); @@ -671,6 +693,7 @@ public function testValidatePostWithDisabledFields() { * test validating post data with posted unlocked fields. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostDisabledFieldsInData() { $event = new Event('Controller.startup', $this->Controller); @@ -696,6 +719,7 @@ public function testValidatePostDisabledFieldsInData() { * test that missing 'unlocked' input causes failure * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostFailNoDisabled() { $event = new Event('Controller.startup', $this->Controller); @@ -720,6 +744,7 @@ public function testValidatePostFailNoDisabled() { * Test that validatePost fails when unlocked fields are changed. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostFailDisabledFieldTampering() { $event = new Event('Controller.startup', $this->Controller); @@ -748,6 +773,7 @@ public function testValidatePostFailDisabledFieldTampering() { * testValidateHiddenMultipleModel method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidateHiddenMultipleModel() { $event = new Event('Controller.startup', $this->Controller); @@ -769,6 +795,7 @@ public function testValidateHiddenMultipleModel() { * testValidateHasManyModel method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidateHasManyModel() { $event = new Event('Controller.startup', $this->Controller); @@ -799,6 +826,7 @@ public function testValidateHasManyModel() { * testValidateHasManyRecordsPass method * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidateHasManyRecordsPass() { $event = new Event('Controller.startup', $this->Controller); @@ -841,6 +869,7 @@ public function testValidateHasManyRecordsPass() { * Test that values like Foo.0.1 * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidateNestedNumericSets() { $event = new Event('Controller.startup', $this->Controller); @@ -866,6 +895,7 @@ public function testValidateNestedNumericSets() { * validatePost should fail, hidden fields have been changed. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidateHasManyRecordsFail() { $event = new Event('Controller.startup', $this->Controller); @@ -908,6 +938,7 @@ public function testValidateHasManyRecordsFail() { * testFormDisabledFields method * * @return void + * @triggers Controller.startup $this->Controller */ public function testFormDisabledFields() { $event = new Event('Controller.startup', $this->Controller); @@ -939,6 +970,7 @@ public function testFormDisabledFields() { * test validatePost with radio buttons * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostRadio() { $event = new Event('Controller.startup', $this->Controller); @@ -978,6 +1010,7 @@ public function testValidatePostRadio() { * test validatePost uses here() as a hash input. * * @return void + * @triggers Controller.startup $this->Controller */ public function testValidatePostUrlAsHashInput() { $event = new Event('Controller.startup', $this->Controller); @@ -1012,6 +1045,7 @@ public function testValidatePostUrlAsHashInput() { * * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/214 * @return void + * @triggers Controller.startup $this->Controller */ public function testBlackHoleNotDeletingSessionInformation() { $event = new Event('Controller.startup', $this->Controller); @@ -1038,6 +1072,7 @@ public function testGenerateToken() { * Test unlocked actions * * @return void + * @triggers Controller.startup $this->Controller */ public function testUnlockedActions() { $_SERVER['REQUEST_METHOD'] = 'POST'; diff --git a/tests/TestCase/Event/EventManagerTest.php b/tests/TestCase/Event/EventManagerTest.php index 03783005630..4b1633422dc 100644 --- a/tests/TestCase/Event/EventManagerTest.php +++ b/tests/TestCase/Event/EventManagerTest.php @@ -190,6 +190,7 @@ public function testDetachFromAll() { * Tests event dispatching * * @return void + * @triggers fake.event */ public function testDispatch() { $manager = new EventManager(); @@ -224,6 +225,7 @@ public function testDispatchWithKeyName() { * Tests event dispatching with a return value * * @return void + * @triggers fake.event */ public function testDispatchReturnValue() { $this->skipIf( @@ -251,6 +253,7 @@ public function testDispatchReturnValue() { * Tests that returning false in a callback stops the event * * @return void + * @triggers fake.event */ public function testDispatchFalseStopsEvent() { $this->skipIf( @@ -278,6 +281,7 @@ public function testDispatchFalseStopsEvent() { * Tests event dispatching using priorities * * @return void + * @triggers fake.event */ public function testDispatchPrioritized() { $manager = new EventManager(); @@ -295,6 +299,8 @@ public function testDispatchPrioritized() { * Tests subscribing a listener object and firing the events it subscribed to * * @return void + * @triggers fake.event + * @triggers another.event $this, array(some => data) */ public function testAttachSubscriber() { $manager = new EventManager(); @@ -318,6 +324,7 @@ public function testAttachSubscriber() { * Test implementedEvents binding multiple callbacks to the same event name. * * @return void + * @triggers multiple.handlers */ public function testAttachSubscriberMultiple() { $manager = new EventManager(); @@ -372,6 +379,7 @@ public function testGlobalDispatcherGetter() { * Tests that the global event manager gets the event too from any other manager * * @return void + * @triggers fake.event */ public function testDispatchWithGlobal() { $generalManager = $this->getMock('Cake\Event\EventManager', array('prioritisedListeners')); @@ -388,6 +396,7 @@ public function testDispatchWithGlobal() { * Tests that stopping an event will not notify the rest of the listeners * * @return void + * @triggers fake.event */ public function testStopPropagation() { $generalManager = $this->getMock('Cake\Event\EventManager'); @@ -415,6 +424,7 @@ public function testStopPropagation() { * Tests event dispatching using priorities * * @return void + * @triggers fake.event */ public function testDispatchPrioritizedWithGlobal() { $generalManager = $this->getMock('Cake\Event\EventManager'); @@ -446,6 +456,7 @@ public function testDispatchPrioritizedWithGlobal() { * Tests event dispatching using priorities * * @return void + * @triggers fake.event */ public function testDispatchGlobalBeforeLocal() { $generalManager = $this->getMock('Cake\Event\EventManager'); @@ -482,6 +493,7 @@ public function onMyEvent($event) { /** * Tests events dispatched by a local manager can be handled by * handler registered in the global event manager + * @triggers my_event $manager */ public function testDispatchLocalHandledByGlobal() { $callback = array($this, 'onMyEvent'); @@ -497,6 +509,7 @@ public function testDispatchLocalHandledByGlobal() { * listeners at the same priority. * * @return void + * @triggers fake.event $this) */ public function testDispatchWithGlobalAndLocalEvents() { $listener = new CustomTestEventListenerInterface(); diff --git a/tests/TestCase/Event/EventTest.php b/tests/TestCase/Event/EventTest.php index 5dd802bdceb..ae26624126c 100644 --- a/tests/TestCase/Event/EventTest.php +++ b/tests/TestCase/Event/EventTest.php @@ -31,6 +31,7 @@ class EventTest extends TestCase { * Tests the name() method * * @return void + * @triggers fake.event */ public function testName() { $event = new Event('fake.event'); @@ -41,6 +42,8 @@ public function testName() { * Tests the subject() method * * @return void + * @triggers fake.event $this + * @triggers fake.event */ public function testSubject() { $event = new Event('fake.event', $this); @@ -54,6 +57,7 @@ public function testSubject() { * Tests the event propagation stopping property * * @return void + * @triggers fake.event */ public function testPropagation() { $event = new Event('fake.event'); @@ -66,6 +70,7 @@ public function testPropagation() { * Tests that it is possible to get/set custom data in a event * * @return void + * @triggers fake.event $this, array('some' => 'data') */ public function testEventData() { $event = new Event('fake.event', $this, array('some' => 'data')); @@ -76,6 +81,7 @@ public function testEventData() { * Tests that it is possible to get the name and subject directly * * @return void + * @triggers fake.event $this */ public function testEventDirectPropertyAccess() { $event = new Event('fake.event', $this); diff --git a/tests/TestCase/Model/Behavior/TimestampBehaviorTest.php b/tests/TestCase/Model/Behavior/TimestampBehaviorTest.php index 97cac47579d..e46b230a329 100644 --- a/tests/TestCase/Model/Behavior/TimestampBehaviorTest.php +++ b/tests/TestCase/Model/Behavior/TimestampBehaviorTest.php @@ -81,6 +81,7 @@ public function testImplementedEventsCustom() { * testCreatedAbsent * * @return void + * @triggers Model.beforeSave */ public function testCreatedAbsent() { $table = $this->getMock('Cake\ORM\Table'); @@ -101,6 +102,7 @@ public function testCreatedAbsent() { * testCreatedPresent * * @return void + * @triggers Model.beforeSave */ public function testCreatedPresent() { $table = $this->getMock('Cake\ORM\Table'); @@ -121,6 +123,7 @@ public function testCreatedPresent() { * testCreatedNotNew * * @return void + * @triggers Model.beforeSave */ public function testCreatedNotNew() { $table = $this->getMock('Cake\ORM\Table'); @@ -141,6 +144,7 @@ public function testCreatedNotNew() { * testModifiedAbsent * * @return void + * @triggers Model.beforeSave */ public function testModifiedAbsent() { $table = $this->getMock('Cake\ORM\Table'); @@ -162,6 +166,7 @@ public function testModifiedAbsent() { * testModifiedPresent * * @return void + * @triggers Model.beforeSave */ public function testModifiedPresent() { $table = $this->getMock('Cake\ORM\Table'); @@ -187,6 +192,7 @@ public function testModifiedPresent() { * @expectedException \UnexpectedValueException * @expectedExceptionMessage When should be one of "always", "new" or "existing". The passed value "fat fingers" is invalid * @return void + * @triggers Model.beforeSave */ public function testInvalidEventConfig() { $table = $this->getMock('Cake\ORM\Table'); diff --git a/tests/TestCase/Routing/DispatcherFilterTest.php b/tests/TestCase/Routing/DispatcherFilterTest.php index f64f09ffd27..5c18088d6f1 100644 --- a/tests/TestCase/Routing/DispatcherFilterTest.php +++ b/tests/TestCase/Routing/DispatcherFilterTest.php @@ -75,6 +75,10 @@ public function testConstructorInvalidWhen() { * Test basic matching with for option. * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('request') + * @triggers Dispatcher.beforeDispatch $this, compact('request') + * @triggers Dispatcher.beforeDispatch $this, compact('request') + * @triggers Dispatcher.beforeDispatch $this, compact('request') */ public function testMatchesWithFor() { $request = new Request(['url' => '/articles/view']); @@ -100,6 +104,7 @@ public function testMatchesWithFor() { * Test matching with when option. * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') */ public function testMatchesWithWhen() { $matcher = function ($request, $response) { @@ -125,6 +130,7 @@ public function testMatchesWithWhen() { * Test matching with for & when option. * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') */ public function testMatchesWithForAndWhen() { $request = new Request(['url' => '/articles/view']); @@ -154,6 +160,8 @@ public function testMatchesWithForAndWhen() { * Test event bindings have use condition checker * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') + * @triggers Dispatcher.afterDispatch $this, compact('response', 'request') */ public function testImplementedEventsMethodName() { $request = new Request(['url' => '/articles/view']); @@ -178,6 +186,7 @@ public function testImplementedEventsMethodName() { * Test handle applies for conditions * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') */ public function testHandleAppliesFor() { $request = new Request(['url' => '/articles/view']); @@ -200,6 +209,7 @@ public function testHandleAppliesFor() { * Test handle applies when conditions * * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') */ public function testHandleAppliesWhen() { $request = new Request(['url' => '/articles/view']); diff --git a/tests/TestCase/Routing/Filter/AssetFilterTest.php b/tests/TestCase/Routing/Filter/AssetFilterTest.php index b96774eb335..3f53efe0fbe 100644 --- a/tests/TestCase/Routing/Filter/AssetFilterTest.php +++ b/tests/TestCase/Routing/Filter/AssetFilterTest.php @@ -52,6 +52,8 @@ public function tearDown() { * file dispatching * * @return void + * @triggers DispatcherTest $this, compact('request', 'response') + * @triggers DispatcherTest $this, compact('request', 'response') */ public function testNotModified() { $filter = new AssetFilter(); @@ -89,6 +91,7 @@ public function testNotModified() { * Test that no exceptions are thrown for //index.php type URLs. * * @return void + * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') */ public function test404OnDoubleSlash() { $filter = new AssetFilter(); @@ -105,6 +108,8 @@ public function test404OnDoubleSlash() { * Test that 404's are returned when .. is in the URL * * @return voi + * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') + * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') */ public function test404OnDoubleDot() { $filter = new AssetFilter(); @@ -215,6 +220,7 @@ public static function assetProvider() { * * @dataProvider assetProvider * @return void + * @triggers Dispatcher.beforeDispatch $this, compact('request', 'response') */ public function testAsset($url, $file) { Plugin::load(array('Company/TestPluginThree', 'TestPlugin', 'PluginJs')); diff --git a/tests/TestCase/Routing/Filter/LocaleSelectorFilterTest.php b/tests/TestCase/Routing/Filter/LocaleSelectorFilterTest.php index 6bc6b01f0f7..77827737013 100644 --- a/tests/TestCase/Routing/Filter/LocaleSelectorFilterTest.php +++ b/tests/TestCase/Routing/Filter/LocaleSelectorFilterTest.php @@ -49,6 +49,9 @@ public function tearDown() { * Tests selecting a language from a http header * * @return void + * @triggers name null, [request => $request]) + * @triggers name null, [request => $request]) + * @triggers name null, [request => $request]) */ public function testSimpleSelection() { $filter = new LocaleSelectorFilter(); @@ -75,6 +78,8 @@ public function testSimpleSelection() { * Tests selecting a language from a http header and filtering by a whitelist * * @return void + * @triggers name null, [request => $request]) + * @triggers name null, [request => $request]) */ public function testWithWhitelist() { Locale::setDefault('en_US'); diff --git a/tests/TestCase/Routing/Filter/RoutingFilterTest.php b/tests/TestCase/Routing/Filter/RoutingFilterTest.php index 8383e153837..a529e36247c 100644 --- a/tests/TestCase/Routing/Filter/RoutingFilterTest.php +++ b/tests/TestCase/Routing/Filter/RoutingFilterTest.php @@ -29,6 +29,7 @@ class RoutingFilterTest extends TestCase { * test setting parameters in beforeDispatch method * * @return void + * @triggers __CLASS__ $this, compact(request) */ public function testBeforeDispatchSkipWhenControllerSet() { $filter = new RoutingFilter(); @@ -46,6 +47,7 @@ public function testBeforeDispatchSkipWhenControllerSet() { * test setting parameters in beforeDispatch method * * @return void + * @triggers __CLASS__ $this, compact(request) */ public function testBeforeDispatchSetsParameters() { Router::connect('/:controller/:action/*'); @@ -67,6 +69,8 @@ public function testBeforeDispatchSetsParameters() { * test setting parameters in beforeDispatch method * * @return void + * @triggers __CLASS__ $this, compact(request) + * @triggers __CLASS__ $this, compact(request) */ public function testQueryStringOnRoot() { Router::reload();