test.ctp 1.9 KB

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