_forControllerName = $this->_resource->getAttribute('forControllerName'); $this->_filesystemName = ucfirst($this->_forControllerName) . 'ControllerTest.php'; parent::init(); return $this; } /** * getPersistentAttributes() * * @return unknown */ public function getPersistentAttributes() { $attributes = array(); if ($this->_forControllerName) { $attributes['forControllerName'] = $this->getForControllerName(); } return $attributes; } public function getForControllerName() { return $this->_forControllerName; } /** * getContents() * * @return string */ public function getContents() { $filter = new Zend_Filter_Word_DashToCamelCase(); $className = $filter->filter($this->_forControllerName) . 'ControllerTest'; /* @var $controllerDirectoryResource Zend_Tool_Project_Profile_Resource */ $controllerDirectoryResource = $this->_resource->getParentResource(); if ($controllerDirectoryResource->getParentResource()->getName() == 'TestApplicationModuleDirectory') { $className = ucfirst($controllerDirectoryResource->getParentResource()->getForModuleName()) . '_' . $className; } $codeGenFile = new Zend_CodeGenerator_Php_File(array( 'classes' => array( new Zend_CodeGenerator_Php_Class(array( 'name' => $className, 'extendedClass' => 'Zend_Test_PHPUnit_ControllerTestCase', 'methods' => array( new Zend_CodeGenerator_Php_Method(array( 'name' => 'setUp', 'body' => <<bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini'); parent::setUp(); EOS )) ) )) ) )); return $codeGenFile->generate(); } }