mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add @trigger doc blocks of methods triggering CakeEvent
This commit is contained in:
parent
ac02350f41
commit
fb61d9393b
12 changed files with 73 additions and 0 deletions
|
@ -669,6 +669,8 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* - triggers Component `startup` methods.
|
* - triggers Component `startup` methods.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Controller.initialize $this
|
||||||
|
* @triggers Controller.startup $this
|
||||||
*/
|
*/
|
||||||
public function startupProcess() {
|
public function startupProcess() {
|
||||||
$this->getEventManager()->dispatch(new CakeEvent('Controller.initialize', $this));
|
$this->getEventManager()->dispatch(new CakeEvent('Controller.initialize', $this));
|
||||||
|
@ -683,6 +685,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* - calls the Controller's `afterFilter` method.
|
* - calls the Controller's `afterFilter` method.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Controller.shutdown $this
|
||||||
*/
|
*/
|
||||||
public function shutdownProcess() {
|
public function shutdownProcess() {
|
||||||
$this->getEventManager()->dispatch(new CakeEvent('Controller.shutdown', $this));
|
$this->getEventManager()->dispatch(new CakeEvent('Controller.shutdown', $this));
|
||||||
|
@ -751,6 +754,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* @param int $status Optional HTTP status code (eg: 404)
|
* @param int $status Optional HTTP status code (eg: 404)
|
||||||
* @param bool $exit If true, exit() will be called after the redirect
|
* @param bool $exit If true, exit() will be called after the redirect
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Controller.beforeRedirect $this, array($url, $status, $exit)
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::redirect
|
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::redirect
|
||||||
*/
|
*/
|
||||||
public function redirect($url, $status = null, $exit = true) {
|
public function redirect($url, $status = null, $exit = true) {
|
||||||
|
@ -920,6 +924,7 @@ class Controller extends Object implements CakeEventListener {
|
||||||
* @param string $view View to use for rendering
|
* @param string $view View to use for rendering
|
||||||
* @param string $layout Layout to use
|
* @param string $layout Layout to use
|
||||||
* @return CakeResponse A response object containing the rendered view.
|
* @return CakeResponse A response object containing the rendered view.
|
||||||
|
* @triggers Controller.beforeRender $this
|
||||||
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::render
|
* @link http://book.cakephp.org/2.0/en/controllers.html#Controller::render
|
||||||
*/
|
*/
|
||||||
public function render($view = null, $layout = null) {
|
public function render($view = null, $layout = null) {
|
||||||
|
|
|
@ -221,6 +221,7 @@ class CakeEventManager {
|
||||||
*
|
*
|
||||||
* @param string|CakeEvent $event the event key name or instance of CakeEvent
|
* @param string|CakeEvent $event the event key name or instance of CakeEvent
|
||||||
* @return CakeEvent
|
* @return CakeEvent
|
||||||
|
* @triggers $event
|
||||||
*/
|
*/
|
||||||
public function dispatch($event) {
|
public function dispatch($event) {
|
||||||
if (is_string($event)) {
|
if (is_string($event)) {
|
||||||
|
|
|
@ -1699,6 +1699,8 @@ class Model extends Object implements CakeEventListener {
|
||||||
* @param array $fieldList List of fields to allow to be saved
|
* @param array $fieldList List of fields to allow to be saved
|
||||||
* @return mixed On success Model::$data if its not empty or true, false on failure
|
* @return mixed On success Model::$data if its not empty or true, false on failure
|
||||||
* @throws PDOException
|
* @throws PDOException
|
||||||
|
* @triggers Model.beforeSave $this, array($options)
|
||||||
|
* @triggers Model.afterSave $this, array($created, $options)
|
||||||
* @link http://book.cakephp.org/2.0/en/models/saving-your-data.html
|
* @link http://book.cakephp.org/2.0/en/models/saving-your-data.html
|
||||||
*/
|
*/
|
||||||
public function save($data = null, $validate = true, $fieldList = array()) {
|
public function save($data = null, $validate = true, $fieldList = array()) {
|
||||||
|
@ -2591,6 +2593,8 @@ class Model extends Object implements CakeEventListener {
|
||||||
* @param int|string $id ID of record to delete
|
* @param int|string $id ID of record to delete
|
||||||
* @param bool $cascade Set to true to delete records that depend on this record
|
* @param bool $cascade Set to true to delete records that depend on this record
|
||||||
* @return bool True on success
|
* @return bool True on success
|
||||||
|
* @triggers Model.beforeDelete $this, array($cascade)
|
||||||
|
* @triggers Model.afterDelete $this)
|
||||||
* @link http://book.cakephp.org/2.0/en/models/deleting-data.html
|
* @link http://book.cakephp.org/2.0/en/models/deleting-data.html
|
||||||
*/
|
*/
|
||||||
public function delete($id = null, $cascade = true) {
|
public function delete($id = null, $cascade = true) {
|
||||||
|
@ -2964,6 +2968,7 @@ class Model extends Object implements CakeEventListener {
|
||||||
* @param string $type Type of find operation (all / first / count / neighbors / list / threaded)
|
* @param string $type Type of find operation (all / first / count / neighbors / list / threaded)
|
||||||
* @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks)
|
* @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks)
|
||||||
* @return array|null Query array or null if it could not be build for some reasons
|
* @return array|null Query array or null if it could not be build for some reasons
|
||||||
|
* @triggers Model.beforeFind $this, array($query)
|
||||||
* @see Model::find()
|
* @see Model::find()
|
||||||
*/
|
*/
|
||||||
public function buildQuery($type = 'first', $query = array()) {
|
public function buildQuery($type = 'first', $query = array()) {
|
||||||
|
@ -3252,6 +3257,7 @@ class Model extends Object implements CakeEventListener {
|
||||||
* @param array $results Results to filter
|
* @param array $results Results to filter
|
||||||
* @param bool $primary If this is the primary model results (results from model where the find operation was performed)
|
* @param bool $primary If this is the primary model results (results from model where the find operation was performed)
|
||||||
* @return array Set of filtered results
|
* @return array Set of filtered results
|
||||||
|
* @triggers Model.afterFind $this, array($results, $primary)
|
||||||
*/
|
*/
|
||||||
protected function _filterResults($results, $primary = true) {
|
protected function _filterResults($results, $primary = true) {
|
||||||
$event = new CakeEvent('Model.afterFind', $this, array($results, $primary));
|
$event = new CakeEvent('Model.afterFind', $this, array($results, $primary));
|
||||||
|
|
|
@ -235,6 +235,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
||||||
*
|
*
|
||||||
* @param string $options An optional array of custom options to be made available in the beforeValidate callback
|
* @param string $options An optional array of custom options to be made available in the beforeValidate callback
|
||||||
* @return array Array of invalid fields
|
* @return array Array of invalid fields
|
||||||
|
* @triggers Model.afterValidate $model
|
||||||
* @see ModelValidator::validates()
|
* @see ModelValidator::validates()
|
||||||
*/
|
*/
|
||||||
public function errors($options = array()) {
|
public function errors($options = array()) {
|
||||||
|
@ -444,6 +445,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
||||||
*
|
*
|
||||||
* @param array $options Options to pass to callback.
|
* @param array $options Options to pass to callback.
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @triggers Model.beforeValidate $model, array($options)
|
||||||
*/
|
*/
|
||||||
protected function _triggerBeforeValidate($options = array()) {
|
protected function _triggerBeforeValidate($options = array()) {
|
||||||
$model = $this->getModel();
|
$model = $this->getModel();
|
||||||
|
|
|
@ -138,6 +138,8 @@ class Dispatcher implements CakeEventListener {
|
||||||
* @param CakeResponse $response Response object to put the results of the dispatch into.
|
* @param CakeResponse $response Response object to put the results of the dispatch into.
|
||||||
* @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
|
* @param array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
|
||||||
* @return string|void if `$request['return']` is set then it returns response body, null otherwise
|
* @return string|void if `$request['return']` is set then it returns response body, null otherwise
|
||||||
|
* @triggers Dispatcher.beforeDispatch $this, compact('request', 'response', 'additionalParams')
|
||||||
|
* @triggers Dispatcher.afterDispatch $this, compact('request', 'response')
|
||||||
* @throws MissingControllerException When the controller is missing.
|
* @throws MissingControllerException When the controller is missing.
|
||||||
*/
|
*/
|
||||||
public function dispatch(CakeRequest $request, CakeResponse $response, $additionalParams = array()) {
|
public function dispatch(CakeRequest $request, CakeResponse $response, $additionalParams = array()) {
|
||||||
|
|
|
@ -193,6 +193,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching
|
* Tests event dispatching
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatch() {
|
public function testDispatch() {
|
||||||
$manager = new CakeEventManager();
|
$manager = new CakeEventManager();
|
||||||
|
@ -227,6 +228,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching with a return value
|
* Tests event dispatching with a return value
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchReturnValue() {
|
public function testDispatchReturnValue() {
|
||||||
$this->skipIf(
|
$this->skipIf(
|
||||||
|
@ -254,6 +256,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests that returning false in a callback stops the event
|
* Tests that returning false in a callback stops the event
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchFalseStopsEvent() {
|
public function testDispatchFalseStopsEvent() {
|
||||||
$this->skipIf(
|
$this->skipIf(
|
||||||
|
@ -281,6 +284,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching using priorities
|
* Tests event dispatching using priorities
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchPrioritized() {
|
public function testDispatchPrioritized() {
|
||||||
$manager = new CakeEventManager();
|
$manager = new CakeEventManager();
|
||||||
|
@ -298,6 +302,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching with passed params
|
* Tests event dispatching with passed params
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event $this, array('some' => 'data')
|
||||||
*/
|
*/
|
||||||
public function testDispatchPassingParams() {
|
public function testDispatchPassingParams() {
|
||||||
$manager = new CakeEventManager();
|
$manager = new CakeEventManager();
|
||||||
|
@ -316,6 +321,9 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests subscribing a listener object and firing the events it subscribed to
|
* Tests subscribing a listener object and firing the events it subscribed to
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
|
* @triggers another.event $this, array('some' => 'data')
|
||||||
|
* @triggers multiple.handlers
|
||||||
*/
|
*/
|
||||||
public function testAttachSubscriber() {
|
public function testAttachSubscriber() {
|
||||||
$manager = new CakeEventManager();
|
$manager = new CakeEventManager();
|
||||||
|
@ -380,6 +388,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests that the global event manager gets the event too from any other manager
|
* Tests that the global event manager gets the event too from any other manager
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchWithGlobal() {
|
public function testDispatchWithGlobal() {
|
||||||
$generalManager = $this->getMock('CakeEventManager', array('prioritisedListeners'));
|
$generalManager = $this->getMock('CakeEventManager', array('prioritisedListeners'));
|
||||||
|
@ -396,6 +405,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests that stopping an event will not notify the rest of the listeners
|
* Tests that stopping an event will not notify the rest of the listeners
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testStopPropagation() {
|
public function testStopPropagation() {
|
||||||
$generalManager = $this->getMock('CakeEventManager');
|
$generalManager = $this->getMock('CakeEventManager');
|
||||||
|
@ -423,6 +433,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching using priorities
|
* Tests event dispatching using priorities
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchPrioritizedWithGlobal() {
|
public function testDispatchPrioritizedWithGlobal() {
|
||||||
$generalManager = $this->getMock('CakeEventManager');
|
$generalManager = $this->getMock('CakeEventManager');
|
||||||
|
@ -454,6 +465,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* Tests event dispatching using priorities
|
* Tests event dispatching using priorities
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testDispatchGlobalBeforeLocal() {
|
public function testDispatchGlobalBeforeLocal() {
|
||||||
$generalManager = $this->getMock('CakeEventManager');
|
$generalManager = $this->getMock('CakeEventManager');
|
||||||
|
@ -490,6 +502,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
/**
|
/**
|
||||||
* Tests events dispatched by a local manager can be handled by
|
* Tests events dispatched by a local manager can be handled by
|
||||||
* handler registered in the global event manager
|
* handler registered in the global event manager
|
||||||
|
* @triggers my_event $manager
|
||||||
*/
|
*/
|
||||||
public function testDispatchLocalHandledByGlobal() {
|
public function testDispatchLocalHandledByGlobal() {
|
||||||
$callback = array($this, 'onMyEvent');
|
$callback = array($this, 'onMyEvent');
|
||||||
|
@ -505,6 +518,7 @@ class CakeEventManagerTest extends CakeTestCase {
|
||||||
* listeners at the same priority.
|
* listeners at the same priority.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event $this)
|
||||||
*/
|
*/
|
||||||
public function testDispatchWithGlobalAndLocalEvents() {
|
public function testDispatchWithGlobalAndLocalEvents() {
|
||||||
$listener = new CustomTestEventListener();
|
$listener = new CustomTestEventListener();
|
||||||
|
|
|
@ -30,6 +30,7 @@ class CakeEventTest extends CakeTestCase {
|
||||||
* Tests the name() method
|
* Tests the name() method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testName() {
|
public function testName() {
|
||||||
$event = new CakeEvent('fake.event');
|
$event = new CakeEvent('fake.event');
|
||||||
|
@ -40,6 +41,8 @@ class CakeEventTest extends CakeTestCase {
|
||||||
* Tests the subject() method
|
* Tests the subject() method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event $this
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testSubject() {
|
public function testSubject() {
|
||||||
$event = new CakeEvent('fake.event', $this);
|
$event = new CakeEvent('fake.event', $this);
|
||||||
|
@ -53,6 +56,7 @@ class CakeEventTest extends CakeTestCase {
|
||||||
* Tests the event propagation stopping property
|
* Tests the event propagation stopping property
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event
|
||||||
*/
|
*/
|
||||||
public function testPropagation() {
|
public function testPropagation() {
|
||||||
$event = new CakeEvent('fake.event');
|
$event = new CakeEvent('fake.event');
|
||||||
|
@ -65,6 +69,7 @@ class CakeEventTest extends CakeTestCase {
|
||||||
* Tests that it is possible to get/set custom data in a event
|
* Tests that it is possible to get/set custom data in a event
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event $this, array('some' => 'data')
|
||||||
*/
|
*/
|
||||||
public function testEventData() {
|
public function testEventData() {
|
||||||
$event = new CakeEvent('fake.event', $this, array('some' => 'data'));
|
$event = new CakeEvent('fake.event', $this, array('some' => 'data'));
|
||||||
|
@ -75,6 +80,7 @@ class CakeEventTest extends CakeTestCase {
|
||||||
* Tests that it is possible to get the name and subject directly
|
* Tests that it is possible to get the name and subject directly
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers fake.event $this
|
||||||
*/
|
*/
|
||||||
public function testEventDirectPropertyAccess() {
|
public function testEventDirectPropertyAccess() {
|
||||||
$event = new CakeEvent('fake.event', $this);
|
$event = new CakeEvent('fake.event', $this);
|
||||||
|
|
|
@ -589,6 +589,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsWithoutZerosAndEmptyPost method
|
* testParseParamsWithoutZerosAndEmptyPost method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $request)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsWithoutZerosAndEmptyPost() {
|
public function testParseParamsWithoutZerosAndEmptyPost() {
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
|
@ -607,6 +608,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsReturnsPostedData method
|
* testParseParamsReturnsPostedData method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $request)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsReturnsPostedData() {
|
public function testParseParamsReturnsPostedData() {
|
||||||
$_POST['testdata'] = "My Posted Content";
|
$_POST['testdata'] = "My Posted Content";
|
||||||
|
@ -622,6 +624,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsWithSingleZero method
|
* testParseParamsWithSingleZero method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $test)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsWithSingleZero() {
|
public function testParseParamsWithSingleZero() {
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
|
@ -640,6 +643,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsWithManySingleZeros method
|
* testParseParamsWithManySingleZeros method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $test)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsWithManySingleZeros() {
|
public function testParseParamsWithManySingleZeros() {
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
|
@ -659,6 +663,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsWithManyZerosInEachSectionOfUrl method
|
* testParseParamsWithManyZerosInEachSectionOfUrl method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $test)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsWithManyZerosInEachSectionOfUrl() {
|
public function testParseParamsWithManyZerosInEachSectionOfUrl() {
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
|
@ -678,6 +683,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method
|
* testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $test)
|
||||||
*/
|
*/
|
||||||
public function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() {
|
public function testParseParamsWithMixedOneToManyZerosInEachSectionOfUrl() {
|
||||||
$Dispatcher = new Dispatcher();
|
$Dispatcher = new Dispatcher();
|
||||||
|
@ -697,6 +703,8 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testQueryStringOnRoot method
|
* testQueryStringOnRoot method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $request)
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $request)
|
||||||
*/
|
*/
|
||||||
public function testQueryStringOnRoot() {
|
public function testQueryStringOnRoot() {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
@ -928,6 +936,7 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testPluginDispatch method
|
* testPluginDispatch method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $Dispatcher, array('request' => $url)
|
||||||
*/
|
*/
|
||||||
public function testPluginDispatch() {
|
public function testPluginDispatch() {
|
||||||
$_POST = array();
|
$_POST = array();
|
||||||
|
@ -1640,6 +1649,11 @@ class DispatcherTest extends CakeTestCase {
|
||||||
* testHttpMethodOverrides method
|
* testHttpMethodOverrides method
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $dispatcher, array('request' => $request)
|
||||||
|
* @triggers DispatcherTest $dispatcher, array('request' => $request)
|
||||||
|
* @triggers DispatcherTest $dispatcher, array('request' => $request)
|
||||||
|
* @triggers DispatcherTest $dispatcher, array('request' => $request)
|
||||||
|
* @triggers DispatcherTest $dispatcher, array('request' => $request)
|
||||||
*/
|
*/
|
||||||
public function testHttpMethodOverrides() {
|
public function testHttpMethodOverrides() {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
|
|
|
@ -39,6 +39,12 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* test that asset filters work for theme and plugin assets
|
* test that asset filters work for theme and plugin assets
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function testAssetFilterForThemeAndPlugins() {
|
public function testAssetFilterForThemeAndPlugins() {
|
||||||
$filter = new AssetDispatcher();
|
$filter = new AssetDispatcher();
|
||||||
|
@ -88,6 +94,7 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* by Routing.
|
* by Routing.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function testNoHandleRoutedExtension() {
|
public function testNoHandleRoutedExtension() {
|
||||||
$filter = new AssetDispatcher();
|
$filter = new AssetDispatcher();
|
||||||
|
@ -115,6 +122,8 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* file dispatching
|
* file dispatching
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
|
* @triggers DispatcherTest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function testNotModified() {
|
public function testNotModified() {
|
||||||
$filter = new AssetDispatcher();
|
$filter = new AssetDispatcher();
|
||||||
|
@ -160,6 +169,7 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* Test that no exceptions are thrown for //index.php type URLs.
|
* Test that no exceptions are thrown for //index.php type URLs.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Dispatcher.beforeRequest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function test404OnDoubleSlash() {
|
public function test404OnDoubleSlash() {
|
||||||
$filter = new AssetDispatcher();
|
$filter = new AssetDispatcher();
|
||||||
|
@ -176,6 +186,7 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* Test that attempts to traverse directories are prevented.
|
* Test that attempts to traverse directories are prevented.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Dispatcher.beforeRequest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function test404OnDoubleDot() {
|
public function test404OnDoubleDot() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
|
@ -198,6 +209,7 @@ class AssetDispatcherTest extends CakeTestCase {
|
||||||
* Test that attempts to traverse directories with urlencoded paths fail.
|
* Test that attempts to traverse directories with urlencoded paths fail.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers Dispatcher.beforeRequest $this, compact('request', 'response')
|
||||||
*/
|
*/
|
||||||
public function test404OnDoubleDotEncoded() {
|
public function test404OnDoubleDotEncoded() {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
|
|
|
@ -535,6 +535,7 @@ class ObjectCollectionTest extends CakeTestCase {
|
||||||
* tests that passing an instance of CakeEvent to trigger will prepend the subject to the list of arguments
|
* tests that passing an instance of CakeEvent to trigger will prepend the subject to the list of arguments
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers callback $subjectClass, array('first argument')
|
||||||
*/
|
*/
|
||||||
public function testDispatchEventWithSubject() {
|
public function testDispatchEventWithSubject() {
|
||||||
$this->_makeMockClasses();
|
$this->_makeMockClasses();
|
||||||
|
@ -560,6 +561,7 @@ class ObjectCollectionTest extends CakeTestCase {
|
||||||
* will NOT prepend the subject to the list of arguments
|
* will NOT prepend the subject to the list of arguments
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
|
* @triggers callback $subjectClass, array('first argument')
|
||||||
*/
|
*/
|
||||||
public function testDispatchEventNoSubject() {
|
public function testDispatchEventNoSubject() {
|
||||||
$this->_makeMockClasses();
|
$this->_makeMockClasses();
|
||||||
|
|
|
@ -213,6 +213,7 @@ abstract class ControllerTestCase extends CakeTestCase {
|
||||||
* @param string $url The url to test
|
* @param string $url The url to test
|
||||||
* @param array $options See options
|
* @param array $options See options
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
* @triggers ControllerTestCase $Dispatch, array('request' => $request
|
||||||
*/
|
*/
|
||||||
protected function _testAction($url = '', $options = array()) {
|
protected function _testAction($url = '', $options = array()) {
|
||||||
$this->vars = $this->result = $this->view = $this->contents = $this->headers = null;
|
$this->vars = $this->result = $this->view = $this->contents = $this->headers = null;
|
||||||
|
|
|
@ -458,6 +458,8 @@ class View extends Object {
|
||||||
* @param string $view Name of view file to use
|
* @param string $view Name of view file to use
|
||||||
* @param string $layout Layout to use.
|
* @param string $layout Layout to use.
|
||||||
* @return string|null Rendered content or null if content already rendered and returned earlier.
|
* @return string|null Rendered content or null if content already rendered and returned earlier.
|
||||||
|
* @triggers View.beforeRender $this, array($viewFileName)
|
||||||
|
* @triggers View.afterRender $this, array($viewFileName)
|
||||||
* @throws CakeException If there is an error in the view.
|
* @throws CakeException If there is an error in the view.
|
||||||
*/
|
*/
|
||||||
public function render($view = null, $layout = null) {
|
public function render($view = null, $layout = null) {
|
||||||
|
@ -504,6 +506,8 @@ class View extends Object {
|
||||||
* @param string $content Content to render in a view, wrapped by the surrounding layout.
|
* @param string $content Content to render in a view, wrapped by the surrounding layout.
|
||||||
* @param string $layout Layout name
|
* @param string $layout Layout name
|
||||||
* @return mixed Rendered output, or false on error
|
* @return mixed Rendered output, or false on error
|
||||||
|
* @triggers View.beforeLayout $this, array($layoutFileName)
|
||||||
|
* @triggers View.afterLayout $this, array($layoutFileName)
|
||||||
* @throws CakeException if there is an error in the view.
|
* @throws CakeException if there is an error in the view.
|
||||||
*/
|
*/
|
||||||
public function renderLayout($content, $layout = null) {
|
public function renderLayout($content, $layout = null) {
|
||||||
|
@ -894,6 +898,8 @@ class View extends Object {
|
||||||
* @param string $viewFile Filename of the view
|
* @param string $viewFile Filename of the view
|
||||||
* @param array $data Data to include in rendered view. If empty the current View::$viewVars will be used.
|
* @param array $data Data to include in rendered view. If empty the current View::$viewVars will be used.
|
||||||
* @return string Rendered output
|
* @return string Rendered output
|
||||||
|
* @triggers View.beforeRenderFile $this, array($viewFile)
|
||||||
|
* @triggers View.afterRenderFile $this, array($viewFile, $content)
|
||||||
* @throws CakeException when a block is left open.
|
* @throws CakeException when a block is left open.
|
||||||
*/
|
*/
|
||||||
protected function _render($viewFile, $data = array()) {
|
protected function _render($viewFile, $data = array()) {
|
||||||
|
@ -1200,6 +1206,8 @@ class View extends Object {
|
||||||
* @param array $data Data to render
|
* @param array $data Data to render
|
||||||
* @param array $options Element options
|
* @param array $options Element options
|
||||||
* @return string
|
* @return string
|
||||||
|
* @triggers View.beforeRender $this, array($file)
|
||||||
|
* @triggers View.afterRender $this, array($file, $element)
|
||||||
*/
|
*/
|
||||||
protected function _renderElement($file, $data, $options) {
|
protected function _renderElement($file, $data, $options) {
|
||||||
if ($options['callbacks']) {
|
if ($options['callbacks']) {
|
||||||
|
|
Loading…
Reference in a new issue