Skip to content

Commit

Permalink
fix: #1410 - webtools not enabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jenovateurs committed Apr 11, 2020
1 parent 18dd7c3 commit 09ad250
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
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 09ad250

Please sign in to comment.