Skip to content

Commit f534823

Browse files
authored
Merge pull request #1342 from phalcon/fix/#1338-create-project-path
#1338 - Fix project path
2 parents e87233d + d3b4eb5 commit f534823

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,3 @@ script:
7070
- vendor/bin/codecept run functional -v
7171
- vendor/bin/codecept run console -v
7272
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/phpstan analyse -l 5 -c phpstan.neon scripts -v'
73-
74-
notifications:
75-
email:
76-
recipients:
77-
78-
on_success: change
79-
on_failure: always
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

tests/console/GenerateProjectCept.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* @var Codeception\Scenario $scenario
5+
*/
6+
7+
$I = new ConsoleTester($scenario);
8+
$I->wantToTest('Generating project');
9+
10+
$output=<<<OUT
11+
Success: Project was successfully created.
12+
OUT;
13+
14+
$projectsFolder = 'projects';
15+
chmod(app_path($projectsFolder), 0777);
16+
17+
$I->amInPath(app_path($projectsFolder));
18+
19+
/**
20+
* Case 1 - default path
21+
*/
22+
$projectName1 = 'project-tests1';
23+
$path1 = $projectsFolder . '/' . $projectName1;
24+
25+
$I->dontSeeFileFound(app_path($path1));
26+
$I->runShellCommand('phalcon project ' . $projectName1);
27+
$I->seeFileFound(app_path($path1));
28+
$I->deleteDir(app_path($path1));
29+
30+
/**
31+
* Case 2 - custom path
32+
*/
33+
$projectName2 = 'project-tests2';
34+
$projectPath2 = 'project-tests2-custom';
35+
$path2 = $projectsFolder . '/' . $projectPath2;
36+
37+
$I->dontSeeFileFound(app_path($path2));
38+
$I->runShellCommand("phalcon project $projectName2 simple $projectPath2");
39+
$I->seeFileFound(app_path($path2));
40+
$I->deleteDir(app_path($path2));

0 commit comments

Comments
 (0)