mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Removing indents from comments
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4864 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a053a1aa7c
commit
a152849bde
1 changed files with 85 additions and 85 deletions
|
@ -36,62 +36,62 @@ vendor('simpletest'.DS.'unit_tester');
|
||||||
* @subpackage cake.cake.tests.lib
|
* @subpackage cake.cake.tests.lib
|
||||||
*/
|
*/
|
||||||
class CakeTestCase extends UnitTestCase {
|
class CakeTestCase extends UnitTestCase {
|
||||||
/**
|
/**
|
||||||
* Methods used internally.
|
* Methods used internally.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
var $methods = array('start', 'end', 'startcase', 'endcase', 'starttest', 'endtest');
|
var $methods = array('start', 'end', 'startcase', 'endcase', 'starttest', 'endtest');
|
||||||
/**
|
/**
|
||||||
* Called when a test case (group of methods) is about to start (to be overriden when needed.)
|
* Called when a test case (group of methods) is about to start (to be overriden when needed.)
|
||||||
*
|
*
|
||||||
* @param string $method Test method about to get executed.
|
* @param string $method Test method about to get executed.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function startCase() {
|
function startCase() {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Called when a test case (group of methods) has been executed (to be overriden when needed.)
|
* Called when a test case (group of methods) has been executed (to be overriden when needed.)
|
||||||
*
|
*
|
||||||
* @param string $method Test method about that was executed.
|
* @param string $method Test method about that was executed.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function endCase() {
|
function endCase() {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Called when a test case method is about to start (to be overriden when needed.)
|
* Called when a test case method is about to start (to be overriden when needed.)
|
||||||
*
|
*
|
||||||
* @param string $method Test method about to get executed.
|
* @param string $method Test method about to get executed.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function startTest($method) {
|
function startTest($method) {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Called when a test case method has been executed (to be overriden when needed.)
|
* Called when a test case method has been executed (to be overriden when needed.)
|
||||||
*
|
*
|
||||||
* @param string $method Test method about that was executed.
|
* @param string $method Test method about that was executed.
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function endTest($method) {
|
function endTest($method) {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Executes a Cake URL, optionally getting the view rendering or what is returned
|
* Executes a Cake URL, optionally getting the view rendering or what is returned
|
||||||
* when params['requested'] is set.
|
* when params['requested'] is set.
|
||||||
*
|
*
|
||||||
* @param string $url Cake URL to execute (e.g: /articles/view/455)
|
* @param string $url Cake URL to execute (e.g: /articles/view/455)
|
||||||
* @param string $requested Set to true if params['requested'] should be set, false otherwise
|
* @param string $requested Set to true if params['requested'] should be set, false otherwise
|
||||||
* @param array $data Data that will be sent to controller. E.g: array('Article' => array('id'=>4))
|
* @param array $data Data that will be sent to controller. E.g: array('Article' => array('id'=>4))
|
||||||
* @param string $method Method to simulate posting of data to controller ('get' or 'post')
|
* @param string $method Method to simulate posting of data to controller ('get' or 'post')
|
||||||
*
|
*
|
||||||
* @return mixed What is returned from action (if $requested is true), or view rendered html
|
* @return mixed What is returned from action (if $requested is true), or view rendered html
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function requestAction($url, $requested = true, $data = null, $method = 'post') {
|
function requestAction($url, $requested = true, $data = null, $method = 'post') {
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
|
@ -111,13 +111,13 @@ class CakeTestCase extends UnitTestCase {
|
||||||
|
|
||||||
return @Object::requestAction($url, $params);
|
return @Object::requestAction($url, $params);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Announces the start of a test.
|
* Announces the start of a test.
|
||||||
*
|
*
|
||||||
* @param string $method Test method just started.
|
* @param string $method Test method just started.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function before($method) {
|
function before($method) {
|
||||||
parent::before($method);
|
parent::before($method);
|
||||||
|
|
||||||
|
@ -170,11 +170,11 @@ class CakeTestCase extends UnitTestCase {
|
||||||
$this->startTest($method);
|
$this->startTest($method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Runs as first test to create tables.
|
* Runs as first test to create tables.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function start() {
|
function start() {
|
||||||
if (isset($this->_fixtures) && isset($this->db)) {
|
if (isset($this->_fixtures) && isset($this->db)) {
|
||||||
foreach($this->_fixtures as $fixture) {
|
foreach($this->_fixtures as $fixture) {
|
||||||
|
@ -186,11 +186,11 @@ class CakeTestCase extends UnitTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Runs as last test to drop tables.
|
* Runs as last test to drop tables.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function end() {
|
function end() {
|
||||||
if (isset($this->_fixtures) && isset($this->db)) {
|
if (isset($this->_fixtures) && isset($this->db)) {
|
||||||
foreach(array_reverse($this->_fixtures) as $fixture) {
|
foreach(array_reverse($this->_fixtures) as $fixture) {
|
||||||
|
@ -202,13 +202,13 @@ class CakeTestCase extends UnitTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Announces the end of a test.
|
* Announces the end of a test.
|
||||||
*
|
*
|
||||||
* @param string $method Test method just finished.
|
* @param string $method Test method just finished.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function after($method) {
|
function after($method) {
|
||||||
if (isset($this->_fixtures) && isset($this->db) && !in_array(low($method), array('start', 'end'))) {
|
if (isset($this->_fixtures) && isset($this->db) && !in_array(low($method), array('start', 'end'))) {
|
||||||
foreach($this->_fixtures as $fixture) {
|
foreach($this->_fixtures as $fixture) {
|
||||||
|
@ -226,24 +226,24 @@ class CakeTestCase extends UnitTestCase {
|
||||||
|
|
||||||
parent::after($method);
|
parent::after($method);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Gets a list of test names. Normally that will be all internal methods that start with the
|
* Gets a list of test names. Normally that will be all internal methods that start with the
|
||||||
* name "test". This method should be overridden if you want a different rule.
|
* name "test". This method should be overridden if you want a different rule.
|
||||||
*
|
*
|
||||||
* @return array List of test names.
|
* @return array List of test names.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function getTests() {
|
function getTests() {
|
||||||
$methods = am(am(array('start', 'startCase'), parent::getTests()), array('endCase', 'end'));
|
$methods = am(am(array('start', 'startCase'), parent::getTests()), array('endCase', 'end'));
|
||||||
|
|
||||||
return $methods;
|
return $methods;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Load fixtures specified in var $fixtures.
|
* Load fixtures specified in var $fixtures.
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
function _loadFixtures() {
|
function _loadFixtures() {
|
||||||
if (!isset($this->fixtures) || empty($this->fixtures)) {
|
if (!isset($this->fixtures) || empty($this->fixtures)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue