Skip to content

Commit

Permalink
Merge pull request #1450 from les-enovateurs/fix_project_enable_webtools
Browse files Browse the repository at this point in the history
fix: #1410 - webtools not enabled by default
  • Loading branch information
Jeckerson authored Apr 11, 2020
2 parents 9845d60 + bca79e2 commit b63dde6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion src/Builder/Project/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Simple extends ProjectBuilder
*/
public function build()
{

$this
->buildDirectories()
->getVariableValues()
Expand All @@ -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'));
}

Expand Down
24 changes: 24 additions & 0 deletions tests/console/GenerateProjectCept.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

0 comments on commit b63dde6

Please sign in to comment.