forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBootstrapCest.php
More file actions
117 lines (91 loc) · 3.97 KB
/
BootstrapCest.php
File metadata and controls
117 lines (91 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
class BootstrapCest
{
protected $bootstrapPath;
function _before(\CliGuy $I)
{
$this->bootstrapPath = 'tests/data/sandbox/boot'.uniqid();
@mkdir($this->bootstrapPath, 0777, true);
$I->amInPath($this->bootstrapPath);
}
public function bootstrap(\CliGuy $I)
{
$I->executeCommand('bootstrap');
$I->seeFileFound('codeception.yml');
$this->checkFilesCreated($I);
$I->seeInShellOutput('Building Actor classes for suites');
}
public function bootstrapWithNamespace(\CliGuy $I)
{
$I->executeCommand('bootstrap --namespace Generated');
$I->seeInShellOutput('Building Actor classes for suites');
$I->seeFileFound('codeception.yml');
$I->seeInThisFile('namespace: Generated');
$I->dontSeeInThisFile('namespace Generated\\');
$this->checkFilesCreated($I);
$I->seeFileFound('AcceptanceHelper.php');
$I->seeInThisFile('namespace Generated\Codeception\Module;');
$I->seeFileFound('AcceptanceTester.php');
$I->seeInThisFile('namespace Generated;');
}
public function bootstrapWithActor(\CliGuy $I)
{
$I->executeCommand('bootstrap --actor Ninja');
$I->seeFileFound('AcceptanceNinja.php','tests/acceptance');
}
public function bootstrapCompatibilityProject(\CliGuy $I) {
$I->executeCommand('bootstrap --compat');
$I->seeFileFound('codeception.yml');
$this->checkCompatFilesCreated($I);
$I->seeInShellOutput('Building Actor classes for suites');
}
public function bootstrapCompatibilityWithNamespace(\CliGuy $I)
{
$I->executeCommand('bootstrap --namespace Generated --compat');
$I->seeInShellOutput('Building Actor classes for suites');
$I->seeFileFound('codeception.yml');
$I->seeInThisFile('namespace: Generated');
$I->dontSeeInThisFile('namespace Generated\\');
$this->checkCompatFilesCreated($I);
$I->seeFileFound('WebHelper.php');
$I->seeInThisFile('namespace Generated\Codeception\Module;');
$I->seeFileFound('WebGuy.php');
$I->seeInThisFile('namespace Generated;');
}
protected function checkFilesCreated(\CliGuy $I)
{
$I->seeDirFound('tests/_support');
$I->seeDirFound('tests/_data');
$I->seeDirFound('tests/_output');
$I->seeFileFound('functional.suite.yml','tests');
$I->seeFileFound('acceptance.suite.yml','tests');
$I->seeFileFound('unit.suite.yml','tests');
$I->seeFileFound('_bootstrap.php','tests/acceptance');
$I->seeFileFound('_bootstrap.php','tests/functional');
$I->seeFileFound('_bootstrap.php','tests/unit');
$I->seeFileFound('AcceptanceTester.php','tests/acceptance');
$I->seeFileFound('FunctionalTester.php','tests/functional');
$I->seeFileFound('UnitTester.php','tests/unit');
$I->seeFileFound('AcceptanceHelper.php','tests/_support');
$I->seeFileFound('FunctionalHelper.php','tests/_support');
$I->seeFileFound('UnitHelper.php','tests/_support');
}
protected function checkCompatFilesCreated(\CliGuy $I)
{
$I->seeDirFound('tests/_log');
$I->seeDirFound('tests/_data');
$I->seeDirFound('tests/_helpers');
$I->seeFileFound('functional.suite.yml','tests');
$I->seeFileFound('acceptance.suite.yml','tests');
$I->seeFileFound('unit.suite.yml','tests');
$I->seeFileFound('_bootstrap.php','tests/acceptance');
$I->seeFileFound('_bootstrap.php','tests/functional');
$I->seeFileFound('_bootstrap.php','tests/unit');
$I->seeFileFound('WebGuy.php','tests/acceptance');
$I->seeFileFound('TestGuy.php','tests/functional');
$I->seeFileFound('CodeGuy.php','tests/unit');
$I->seeFileFound('WebHelper.php','tests/_helpers');
$I->seeFileFound('TestHelper.php','tests/_helpers');
$I->seeFileFound('CodeHelper.php','tests/_helpers');
}
}