2009-07-01 04:24:20 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Test Case bake template
|
|
|
|
*
|
|
|
|
*
|
2010-10-03 16:38:58 +00:00
|
|
|
* PHP 5
|
2009-07-01 04:24:20 +00:00
|
|
|
*
|
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2011-05-29 21:31:39 +00:00
|
|
|
* Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2009-07-01 04:24:20 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2011-05-29 21:31:39 +00:00
|
|
|
* @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2010-01-26 22:03:03 +00:00
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2010-12-24 18:57:20 +00:00
|
|
|
* @package cake.console.libs.templates.objects
|
2009-07-01 04:24:20 +00:00
|
|
|
* @since CakePHP(tm) v 1.3
|
|
|
|
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
|
|
|
*/
|
|
|
|
echo "<?php\n";
|
2011-01-12 01:16:42 +00:00
|
|
|
echo "/* ". $className ." Test cases generated on: " . date('Y-m-d H:i:s') . " : ". time() . "*/\n";
|
2009-07-01 04:24:20 +00:00
|
|
|
?>
|
2011-03-16 02:14:10 +00:00
|
|
|
App::uses('<?php echo $fullClassName; ?>', '<?php echo $plugin . $type;?>');
|
2009-07-01 04:24:20 +00:00
|
|
|
|
|
|
|
<?php if ($mock and strtolower($type) == 'controller'): ?>
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* Test<?php echo $fullClassName; ?>
|
|
|
|
*
|
|
|
|
*/
|
2009-07-01 04:24:20 +00:00
|
|
|
class Test<?php echo $fullClassName; ?> extends <?php echo $fullClassName; ?> {
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* Auto render
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2010-04-04 06:46:01 +00:00
|
|
|
public $autoRender = false;
|
2009-07-01 04:24:20 +00:00
|
|
|
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* Redirect action
|
|
|
|
*
|
|
|
|
* @param mixed $url
|
|
|
|
* @param mixed $status
|
|
|
|
* @param boolean $exit
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-04-04 06:46:01 +00:00
|
|
|
public function redirect($url, $status = null, $exit = true) {
|
2009-07-01 04:24:20 +00:00
|
|
|
$this->redirectUrl = $url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<?php endif; ?>
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* <?php echo $fullClassName; ?> Test Case
|
|
|
|
*
|
|
|
|
*/
|
2009-07-01 04:24:20 +00:00
|
|
|
class <?php echo $fullClassName; ?>TestCase extends CakeTestCase {
|
|
|
|
<?php if (!empty($fixtures)): ?>
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* Fixtures
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
2010-04-04 06:46:01 +00:00
|
|
|
public $fixtures = array('<?php echo join("', '", $fixtures); ?>');
|
2009-07-01 04:24:20 +00:00
|
|
|
|
|
|
|
<?php endif; ?>
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
2011-01-21 15:25:30 +00:00
|
|
|
* setUp method
|
2011-01-20 00:22:50 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-01-21 15:25:30 +00:00
|
|
|
public function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
|
2010-11-13 04:05:44 +00:00
|
|
|
$this-><?php echo $className . ' = ' . $construction; ?>
|
2009-07-01 04:24:20 +00:00
|
|
|
}
|
|
|
|
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
2011-01-21 15:25:30 +00:00
|
|
|
* tearDown method
|
2011-01-20 00:22:50 +00:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2011-01-21 15:25:30 +00:00
|
|
|
public function tearDown() {
|
2009-07-01 04:24:20 +00:00
|
|
|
unset($this-><?php echo $className;?>);
|
|
|
|
ClassRegistry::flush();
|
2011-01-21 15:25:30 +00:00
|
|
|
|
|
|
|
parent::tearDown();
|
2009-07-01 04:24:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<?php foreach ($methods as $method): ?>
|
2011-01-20 00:22:50 +00:00
|
|
|
/**
|
|
|
|
* test<?php echo Inflector::classify($method); ?> method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2010-04-04 06:46:01 +00:00
|
|
|
public function test<?php echo Inflector::classify($method); ?>() {
|
2009-07-24 19:18:37 +00:00
|
|
|
|
2009-07-01 04:24:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
<?php endforeach;?>
|
|
|
|
}
|