Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
383 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since CakePHP(tm) v 3.0.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\Controller; | ||
|
||
abstract class AbstractController extends Controller { | ||
|
||
abstract public function index(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since CakePHP(tm) v 3.0.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\Controller; | ||
use Cake\Network\Response; | ||
|
||
/** | ||
* SomePagesController class | ||
* | ||
* @package Cake.Test.Case.Routing | ||
*/ | ||
class SomePagesController extends Controller { | ||
|
||
/** | ||
* name property | ||
* | ||
* @var string 'SomePages' | ||
*/ | ||
public $name = 'SomePages'; | ||
|
||
/** | ||
* uses property | ||
* | ||
* @var array | ||
*/ | ||
public $uses = array(); | ||
|
||
/** | ||
* display method | ||
* | ||
* @param mixed $page | ||
* @return void | ||
*/ | ||
public function display($page = null) { | ||
return $page; | ||
} | ||
|
||
/** | ||
* index method | ||
* | ||
* @return void | ||
*/ | ||
public function index() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Test method for returning responses. | ||
* | ||
* @return Cake\Network\Response | ||
*/ | ||
public function responseGenerator() { | ||
return new Response(array('body' => 'new response')); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since CakePHP(tm) v 3.0.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\Controller; | ||
|
||
/** | ||
* SomePostsController class | ||
* | ||
* @package Cake.Test.Case.Routing | ||
*/ | ||
class SomePostsController extends Controller { | ||
|
||
/** | ||
* name property | ||
* | ||
* @var string 'SomePosts' | ||
*/ | ||
public $name = 'SomePosts'; | ||
|
||
/** | ||
* uses property | ||
* | ||
* @var array | ||
*/ | ||
public $uses = array(); | ||
|
||
/** | ||
* autoRender property | ||
* | ||
* @var bool false | ||
*/ | ||
public $autoRender = false; | ||
|
||
/** | ||
* beforeFilter method | ||
* | ||
* @return void | ||
*/ | ||
public function beforeFilter() { | ||
if ($this->request->params['action'] == 'index') { | ||
$this->request->params['action'] = 'view'; | ||
} else { | ||
$this->request->params['action'] = 'change'; | ||
} | ||
$this->request->params['pass'] = array('changed'); | ||
} | ||
|
||
/** | ||
* index method | ||
* | ||
* @return void | ||
*/ | ||
public function index() { | ||
return true; | ||
} | ||
|
||
/** | ||
* change method | ||
* | ||
* @return void | ||
*/ | ||
public function change() { | ||
return true; | ||
} | ||
|
||
} |
106 changes: 106 additions & 0 deletions
106
lib/Cake/Test/TestApp/Controller/TestCachedPagesController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\Controller; | ||
|
||
/** | ||
* TestCachedPagesController class | ||
* | ||
* @package Cake.Test.Case.Routing | ||
*/ | ||
class TestCachedPagesController extends Controller { | ||
|
||
/** | ||
* name property | ||
* | ||
* @var string 'TestCachedPages' | ||
*/ | ||
public $name = 'TestCachedPages'; | ||
|
||
/** | ||
* uses property | ||
* | ||
* @var array | ||
*/ | ||
public $uses = array(); | ||
|
||
/** | ||
* helpers property | ||
* | ||
* @var array | ||
*/ | ||
public $helpers = array('Cache', 'Html'); | ||
|
||
/** | ||
* cacheAction property | ||
* | ||
* @var array | ||
*/ | ||
public $cacheAction = array( | ||
'index' => '+2 sec', | ||
'test_nocache_tags' => '+2 sec', | ||
'view' => '+2 sec' | ||
); | ||
|
||
/** | ||
* Mock out the response object so it doesn't send headers. | ||
* | ||
* @var string | ||
*/ | ||
protected $_responseClass = 'Cake\Test\TestCase\Routing\DispatcherMockResponse'; | ||
|
||
/** | ||
* viewPath property | ||
* | ||
* @var string 'posts' | ||
*/ | ||
public $viewPath = 'Posts'; | ||
|
||
/** | ||
* index method | ||
* | ||
* @return void | ||
*/ | ||
public function index() { | ||
$this->render(); | ||
} | ||
|
||
/** | ||
* test_nocache_tags method | ||
* | ||
* @return void | ||
*/ | ||
public function test_nocache_tags() { | ||
$this->render(); | ||
} | ||
|
||
/** | ||
* view method | ||
* | ||
* @return void | ||
*/ | ||
public function view($id = null) { | ||
$this->render('index'); | ||
} | ||
|
||
/** | ||
* test cached forms / tests view object being registered | ||
* | ||
* @return void | ||
*/ | ||
public function cache_form() { | ||
$this->cacheAction = 10; | ||
$this->helpers[] = 'Form'; | ||
} | ||
|
||
/** | ||
* Test cached views with themes. | ||
*/ | ||
public function themed() { | ||
$this->cacheAction = 10; | ||
$this->viewClass = 'Theme'; | ||
$this->theme = 'TestTheme'; | ||
} | ||
|
||
} | ||
|
57 changes: 57 additions & 0 deletions
57
lib/Cake/Test/TestApp/Controller/TestDispatchPagesController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://cakephp.org CakePHP(tm) Project | ||
* @since CakePHP(tm) v 3.0.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace TestApp\Controller; | ||
|
||
use Cake\Controller\Controller; | ||
|
||
/** | ||
* TestDispatchPagesController class | ||
* | ||
* @package Cake.Test.Case.Routing | ||
*/ | ||
class TestDispatchPagesController extends Controller { | ||
|
||
/** | ||
* name property | ||
* | ||
* @var string 'TestDispatchPages' | ||
*/ | ||
public $name = 'TestDispatchPages'; | ||
|
||
/** | ||
* uses property | ||
* | ||
* @var array | ||
*/ | ||
public $uses = array(); | ||
|
||
/** | ||
* admin_index method | ||
* | ||
* @return void | ||
*/ | ||
public function admin_index() { | ||
return true; | ||
} | ||
|
||
/** | ||
* camelCased method | ||
* | ||
* @return void | ||
*/ | ||
public function camelCased() { | ||
return true; | ||
} | ||
|
||
} |
Oops, something went wrong.