diff -r bd595ad770fc -r 1c2f13fd785c web/enmi/Zend/Tool/Project/Context/Zf/TestLibraryFile.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/enmi/Zend/Tool/Project/Context/Zf/TestLibraryFile.php Thu Jan 20 19:30:54 2011 +0100 @@ -0,0 +1,107 @@ +_forClassName = $this->_resource->getAttribute('forClassName'); + $this->_filesystemName = ucfirst(ltrim(strrchr($this->_forClassName, '_'), '_')) . 'Test.php'; + parent::init(); + return $this; + } + + /** + * getContents() + * + * @return string + */ + public function getContents() + { + + $filter = new Zend_Filter_Word_DashToCamelCase(); + + $className = $filter->filter($this->_forClassName) . 'Test'; + + $codeGenFile = new Zend_CodeGenerator_Php_File(array( + 'requiredFiles' => array( + 'PHPUnit/Framework/TestCase.php' + ), + 'classes' => array( + new Zend_CodeGenerator_Php_Class(array( + 'name' => $className, + 'extendedClass' => 'PHPUnit_Framework_TestCase', + 'methods' => array( + new Zend_CodeGenerator_Php_Method(array( + 'name' => 'setUp', + 'body' => ' /* Setup Routine */' + )), + new Zend_CodeGenerator_Php_Method(array( + 'name' => 'tearDown', + 'body' => ' /* Tear Down Routine */' + )) + ) + )) + ) + )); + + return $codeGenFile->generate(); + } + +} \ No newline at end of file