|
|
@@ -134,11 +134,11 @@ class Zend_Tool_Project_Provider_Action
|
|
|
// get request/response object
|
|
|
$request = $this->_registry->getRequest();
|
|
|
$response = $this->_registry->getResponse();
|
|
|
-
|
|
|
+
|
|
|
// determine if testing is enabled in the project
|
|
|
require_once 'Zend/Tool/Project/Provider/Test.php';
|
|
|
$testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile);
|
|
|
-
|
|
|
+
|
|
|
if ($testingEnabled && !Zend_Tool_Project_Provider_Test::isPHPUnitAvailable()) {
|
|
|
$testingEnabled = false;
|
|
|
$response->appendContent(
|
|
|
@@ -146,7 +146,7 @@ class Zend_Tool_Project_Provider_Action
|
|
|
array('color' => array('yellow'))
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Check that there is not a dash or underscore, return if doesnt match regex
|
|
|
if (preg_match('#[_-]#', $name)) {
|
|
|
throw new Zend_Tool_Project_Provider_Exception('Action names should be camel cased.');
|
|
|
@@ -167,6 +167,7 @@ class Zend_Tool_Project_Provider_Action
|
|
|
|
|
|
$actionMethodResource = self::createResource($this->_loadedProfile, $name, $controllerName, $module);
|
|
|
|
|
|
+ $testActionMethodResource = null;
|
|
|
if ($testingEnabled) {
|
|
|
$testActionMethodResource = Zend_Tool_Project_Provider_Test::createApplicationResource($this->_loadedProfile, $controllerName, $name, $module);
|
|
|
}
|
|
|
@@ -199,23 +200,23 @@ class Zend_Tool_Project_Provider_Action
|
|
|
'Would create an action named ' . $name .
|
|
|
' inside controller at ' . $actionMethodResource->getParentResource()->getContext()->getPath()
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
if ($testActionMethodResource) {
|
|
|
$response->appendContent('Would create an action test in ' . $testActionMethodResource->getParentResource()->getContext()->getPath());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
$response->appendContent(
|
|
|
'Creating an action named ' . $name .
|
|
|
' inside controller at ' . $actionMethodResource->getParentResource()->getContext()->getPath()
|
|
|
);
|
|
|
$actionMethodResource->create();
|
|
|
-
|
|
|
+
|
|
|
if ($testActionMethodResource) {
|
|
|
$response->appendContent('Creating an action test in ' . $testActionMethodResource->getParentResource()->getContext()->getPath());
|
|
|
$testActionMethodResource->create();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$this->_storeProfile();
|
|
|
}
|
|
|
|