cakephp2-php8/lib/Cake/Console/Templates/default/classes/test.ctp

107 lines
2.2 KiB
Text
Raw Normal View History

<?php
/**
* Test Case bake template
*
*
2010-10-03 16:38:58 +00:00
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
2012-03-13 02:46:46 +00:00
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
2012-03-13 02:46:46 +00:00
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
2010-01-26 22:03:03 +00:00
* @link http://cakephp.org CakePHP(tm) Project
* @package Cake.Console.Templates.default.classes
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
echo "<?php\n";
?>
<?php foreach ($uses as $dependency): ?>
App::uses('<?php echo $dependency[0]; ?>', '<?php echo $dependency[1]; ?>');
<?php endforeach; ?>
<?php if ($mock and strtolower($type) == 'controller'): ?>
2011-01-20 00:22:50 +00:00
/**
* Test<?php echo $fullClassName; ?>
2011-01-20 00:22:50 +00:00
*
*/
class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> {
2011-01-20 00:22:50 +00:00
/**
* Auto render
*
* @var boolean
*/
public $autoRender = false;
2011-01-20 00:22:50 +00:00
/**
* Redirect action
*
* @param mixed $url
* @param mixed $status
* @param boolean $exit
* @return void
*/
public function redirect($url, $status = null, $exit = true) {
$this->redirectUrl = $url;
}
}
<?php endif; ?>
2011-01-20 00:22:50 +00:00
/**
* <?php echo $fullClassName; ?> Test Case
*
*/
class <?php echo $fullClassName; ?>Test extends CakeTestCase {
<?php if (!empty($fixtures)): ?>
2011-01-20 00:22:50 +00:00
/**
* Fixtures
*
* @var array
*/
public $fixtures = array(
'<?php echo join("',\n\t\t'", $fixtures); ?>'
);
<?php endif; ?>
2011-01-20 00:22:50 +00:00
/**
* setUp method
2011-01-20 00:22:50 +00:00
*
* @return void
*/
public function setUp() {
parent::setUp();
2012-01-27 03:59:26 +00:00
<?php echo $preConstruct ? "\t\t" . $preConstruct : ''; ?>
$this-><?php echo $className . ' = ' . $construction; ?>
2012-01-27 03:59:26 +00:00
<?php echo $postConstruct ? "\t\t" . $postConstruct : ''; ?>
}
2011-01-20 00:22:50 +00:00
/**
* tearDown method
2011-01-20 00:22:50 +00:00
*
* @return void
*/
public function tearDown() {
unset($this-><?php echo $className;?>);
parent::tearDown();
}
<?php foreach ($methods as $method): ?>
2011-01-20 00:22:50 +00:00
/**
* test<?php echo Inflector::camelize($method); ?> method
2011-01-20 00:22:50 +00:00
*
* @return void
*/
public function test<?php echo Inflector::camelize($method); ?>() {
}
<?php endforeach;?>
}