forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunEnvironmentCest.php
More file actions
62 lines (53 loc) · 2.17 KB
/
RunEnvironmentCest.php
File metadata and controls
62 lines (53 loc) · 2.17 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
<?php
use \CliGuy;
class RunEnvironmentCest
{
public function testDevEnvironment(CliGuy $I)
{
$I->wantTo('execute test in --dev environment');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run dummy --env=dev');
$I->seeInShellOutput("OK (");
}
public function testProdEnvironment(CliGuy $I)
{
$I->wantTo('execute test in non existent --prod environment');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run dummy --env=prod');
$I->dontSeeInShellOutput("OK (");
$I->seeInShellOutput("No tests executed");
}
public function testEnvironmentParams(CliGuy $I)
{
$I->wantTo('execute check that env params applied');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run powers PowerIsRisingCept.php --env=dev -vv --steps');
$I->seeInShellOutput('I got the power');
$I->seeInShellOutput("PASSED");
$I->seeInShellOutput("OK (");
}
public function testWithoutEnvironmentParams(CliGuy $I)
{
$I->wantTo('execute check that env params applied');
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run powers PowerIsRisingCept.php -vv --no-exit');
$I->seeInShellOutput("I have no power");
$I->seeInShellOutput("FAIL");
}
public function runTestForSpecificEnvironment(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run powers MageGuildCest.php --env whisky');
$I->seeInShellOutput('Trying to red label (MageGuildCest::redLabel)');
$I->seeInShellOutput('Trying to black label (MageGuildCest::blackLabel)');
$I->seeInShellOutput('Trying to power of the universe (MageGuildCest::powerOfTheUniverse)');
$I->seeInShellOutput('OK (3 tests, 3 assertions)');
}
public function runTestForNotIncludedEnvironment(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run powers MageGuildCest.php --env dev');
$I->seeInShellOutput('Trying to power of the universe (MageGuildCest::powerOfTheUniverse)');
$I->seeInShellOutput('OK (1 test, 1 assertion)');
}
}