From 4321d51339851fe5f175c6c3e19b070efd01b7ac Mon Sep 17 00:00:00 2001 From: Regan King Date: Tue, 12 Feb 2019 13:37:14 -0800 Subject: [PATCH] Fix for generate:controller. See https://github.com/hechoendrupal/drupal-console/issues/3998 (#3999) --- src/Extension/Extension.php | 5 +++-- src/Generator/ControllerGenerator.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Extension/Extension.php b/src/Extension/Extension.php index f664d1435..8da5f9c44 100644 --- a/src/Extension/Extension.php +++ b/src/Extension/Extension.php @@ -134,12 +134,13 @@ public function getTemplatePath($fullPath = false) } /** + * @param string $testType * @param bool $fullPath * @return string */ - public function getTestsPath($fullPath = false) + public function getTestsPath($testType, $fullPath = false) { - return $this->getPath($fullPath) . '/tests'; + return $this->getPath($fullPath) . '/tests/' . $testType; } /** diff --git a/src/Generator/ControllerGenerator.php b/src/Generator/ControllerGenerator.php index 49d51e510..1a392e499 100644 --- a/src/Generator/ControllerGenerator.php +++ b/src/Generator/ControllerGenerator.php @@ -54,7 +54,7 @@ public function generate(array $parameters) if ($test) { $this->renderFile( 'module/Tests/Controller/controller.php.twig', - $moduleInstance->getTestPath('Controller') . '/' . $class . 'Test.php', + $moduleInstance->getTestsPath('Controller') . '/' . $class . 'Test.php', $parameters ); }