Added check for duplicate methods to prevent fatal php error

This commit is contained in:
Scott Harwell 2012-01-16 14:45:12 -05:00
parent f11389fd10
commit 33dc57e667

View file

@ -84,15 +84,21 @@ class <?php echo $fullClassName; ?>TestCase extends CakeTestCase {
parent::tearDown(); parent::tearDown();
} }
<?php $methodKeys = array();?>
<?php foreach ($methods as $method): ?> <?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 * @return void
*/ */
public function test<?php echo Inflector::classify($method); ?>() { public function test<?php echo $classifyMethodName; ?>() {
} }
<?php endif; ?>
<?php endforeach;?> <?php endforeach;?>
} }