| 13532 |
anikendra |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Test Case bake template
|
|
|
4 |
*
|
|
|
5 |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
|
|
6 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
7 |
*
|
|
|
8 |
* Licensed under The MIT License
|
|
|
9 |
* For full copyright and license information, please see the LICENSE.txt
|
|
|
10 |
* Redistributions of files must retain the above copyright notice.
|
|
|
11 |
*
|
|
|
12 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
13 |
* @link http://cakephp.org CakePHP(tm) Project
|
|
|
14 |
* @package Cake.Console.Templates.default.classes
|
|
|
15 |
* @since CakePHP(tm) v 1.3
|
|
|
16 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
echo "<?php\n";
|
|
|
20 |
?>
|
|
|
21 |
<?php foreach ($uses as $dependency): ?>
|
|
|
22 |
App::uses('<?php echo $dependency[0]; ?>', '<?php echo $dependency[1]; ?>');
|
|
|
23 |
<?php endforeach; ?>
|
|
|
24 |
|
|
|
25 |
/**
|
|
|
26 |
* <?php echo $fullClassName; ?> Test Case
|
|
|
27 |
*
|
|
|
28 |
*/
|
|
|
29 |
<?php if ($type === 'Controller'): ?>
|
|
|
30 |
class <?php echo $fullClassName; ?>Test extends ControllerTestCase {
|
|
|
31 |
<?php else: ?>
|
|
|
32 |
class <?php echo $fullClassName; ?>Test extends CakeTestCase {
|
|
|
33 |
<?php endif; ?>
|
|
|
34 |
|
|
|
35 |
<?php if (!empty($fixtures)): ?>
|
|
|
36 |
/**
|
|
|
37 |
* Fixtures
|
|
|
38 |
*
|
|
|
39 |
* @var array
|
|
|
40 |
*/
|
|
|
41 |
public $fixtures = array(
|
|
|
42 |
'<?php echo join("',\n\t\t'", $fixtures); ?>'
|
|
|
43 |
);
|
|
|
44 |
|
|
|
45 |
<?php endif; ?>
|
|
|
46 |
<?php if (!empty($construction)): ?>
|
|
|
47 |
/**
|
|
|
48 |
* setUp method
|
|
|
49 |
*
|
|
|
50 |
* @return void
|
|
|
51 |
*/
|
|
|
52 |
public function setUp() {
|
|
|
53 |
parent::setUp();
|
|
|
54 |
<?php echo $preConstruct ? "\t\t" . $preConstruct : ''; ?>
|
|
|
55 |
$this-><?php echo $className . ' = ' . $construction; ?>
|
|
|
56 |
<?php echo $postConstruct ? "\t\t" . $postConstruct : ''; ?>
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* tearDown method
|
|
|
61 |
*
|
|
|
62 |
* @return void
|
|
|
63 |
*/
|
|
|
64 |
public function tearDown() {
|
|
|
65 |
unset($this-><?php echo $className; ?>);
|
|
|
66 |
|
|
|
67 |
parent::tearDown();
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
<?php endif; ?>
|
|
|
71 |
<?php foreach ($methods as $method): ?>
|
|
|
72 |
/**
|
|
|
73 |
* test<?php echo Inflector::camelize($method); ?> method
|
|
|
74 |
*
|
|
|
75 |
* @return void
|
|
|
76 |
*/
|
|
|
77 |
public function test<?php echo Inflector::camelize($method); ?>() {
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
<?php endforeach; ?>
|
|
|
81 |
}
|