diff --git a/CHANGELOG.md b/CHANGELOG.md index f734ea61e..ec2beb7c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,4 @@ - Fixed include order of files in created project [#1417](https://github.com/phalcon/phalcon-devtools/issues/1417) - Fixed Scaffold templates errors and phpstan errors. [#1429](https://github.com/phalcon/phalcon-devtools/issues/1429) [@jenovateurs](https://github.com/jenovateurs) - Fixed duplicate camelCase properties [#1433](https://github.com/phalcon/phalcon-devtools/pull/1433) +- Fixed webtools not enabled by default when creating a new project [#1410](https://github.com/phalcon/phalcon-devtools/issues/1410) [@jenovateurs](https://github.com/jenovateurs) \ No newline at end of file diff --git a/src/Builder/Project/Simple.php b/src/Builder/Project/Simple.php index 9a3cf676a..8a13c926b 100644 --- a/src/Builder/Project/Simple.php +++ b/src/Builder/Project/Simple.php @@ -58,6 +58,7 @@ class Simple extends ProjectBuilder */ public function build() { + $this ->buildDirectories() ->getVariableValues() @@ -69,7 +70,7 @@ public function build() ->createControllerFile() ->createHtrouterFile(); - if ($this->options->has('enableWebTools')) { + if ($this->options->has('enableWebTools') && true === $this->options->enableWebTools) { Tools::install($this->options->get('projectPath')); } diff --git a/tests/console/GenerateProjectCept.php b/tests/console/GenerateProjectCept.php index 8bd30d02e..f2f32ce46 100644 --- a/tests/console/GenerateProjectCept.php +++ b/tests/console/GenerateProjectCept.php @@ -64,3 +64,27 @@ $I->seeFileFound(app_path($path4)); $I->seeFileFound(app_path($path4 . '/app/views/index.volt')); $I->deleteDir(app_path($path4)); + +/** + * Case 5 - Check webtools is disable by default + */ +$projectName5 = 'webtools_defaults'; +$path5 = $projectsFolder . '/' . $projectName5; + +$I->dontSeeFileFound(app_path($path5)); +$I->runShellCommand('phalcon project ' . $projectName5); +$I->dontSeeFileFound(app_path($path5 . '/public/webtools.php')); +$I->dontSeeFileFound(app_path($path5 . '/public/webtools.config.php')); +$I->deleteDir(app_path($path5)); + +/** + * Case 6 - Check webtools file when it's activated + */ +$projectName6 = 'webtools_activated'; +$path6 = $projectsFolder . '/' . $projectName6; + +$I->dontSeeFileFound(app_path($path6)); +$I->runShellCommand('phalcon project ' . $projectName6 . ' --enable-webtools'); +$I->seeFileFound(app_path($path6 . '/public/webtools.php')); +$I->seeFileFound(app_path($path6 . '/public/webtools.config.php')); +$I->deleteDir(app_path($path6));