Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added check for duplicate methods to prevent fatal php error

  • Loading branch information...
commit 33dc57e667390ff7bfb37cd2c7b3cbcc25216a3c 1 parent f11389f
@scottharwell scottharwell authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/Cake/Console/Templates/default/classes/test.ctp
View
12 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;?>
}
Please sign in to comment.
Something went wrong with that request. Please try again.