Skip to content
Permalink
Browse files

Added check for duplicate methods to prevent fatal php error

  • Loading branch information...
scottharwell committed Jan 16, 2012
1 parent f11389f commit 33dc57e667390ff7bfb37cd2c7b3cbcc25216a3c
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/Cake/Console/Templates/default/classes/test.ctp
@@ -84,15 +84,21 @@ class <?php echo $fullClassName; ?>TestCase extends CakeTestCase {
parent::tearDown();
}

<?php $methodKeys = array();?>
<?php foreach ($methods as $method): ?>
<?php
$classifyMethodName = Inflector::classify($method);
if(!in_array($classifyMethodName, $methodKeys)):
$methodKeys[] = $classifyMethodName;
?>
/**
* test<?php echo Inflector::classify($method); ?> method
* test<?php echo $classifyMethodName; ?> method
*
* @return void
*/
public function test<?php echo Inflector::classify($method); ?>() {
public function test<?php echo $classifyMethodName; ?>() {

}

<?php endif; ?>
<?php endforeach;?>
}

0 comments on commit 33dc57e

Please sign in to comment.
You can’t perform that action at this time.