Skip to content

Commit

Permalink
Fix a number of failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jul 4, 2012
1 parent ff49ef3 commit 25c91c4
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 338 deletions.
22 changes: 22 additions & 0 deletions lib/Cake/Test/TestApp/Controller/AbstractController.php
@@ -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();

}
69 changes: 69 additions & 0 deletions lib/Cake/Test/TestApp/Controller/SomePagesController.php
@@ -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'));
}

}

78 changes: 78 additions & 0 deletions lib/Cake/Test/TestApp/Controller/SomePostsController.php
@@ -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 lib/Cake/Test/TestApp/Controller/TestCachedPagesController.php
@@ -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 lib/Cake/Test/TestApp/Controller/TestDispatchPagesController.php
@@ -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;
}

}

0 comments on commit 25c91c4

Please sign in to comment.