Repository navigation
Expand file tree
/
Copy pathConfigParamsCest.php
More file actions
71 lines (59 loc) · 1.86 KB
/
Copy pathConfigParamsCest.php
File metadata and controls
71 lines (59 loc) · 1.86 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
<?php
declare(strict_types=1);
use Codeception\Attribute\Before;
final class ConfigParamsCest
{
private function moveToTestDir(CliGuy $I): void
{
static $prepared = false;
$I->amInPath('tests/data/params');
if ($prepared) {
return;
}
$I->executeCommand('build');
$prepared = true;
}
#[Before('moveToTestDir')]
public function checkYamlParamsPassed(CliGuy $I)
{
$I->executeCommand('run -c codeception_yaml.yml dummy');
$I->seeInShellOutput('OK (1 test');
}
#[Before('moveToTestDir')]
public function checkDotEnvParamsPassed(CliGuy $I)
{
$I->executeCommand('run -c codeception_dotenv.yml dummy');
$I->seeInShellOutput('OK (1 test');
}
#[Before('moveToTestDir')]
public function checkComplexDotEnvParamsPassed(CliGuy $I)
{
$I->executeCommand('run -c codeception_dotenv2.yml dummy');
$I->seeInShellOutput('OK (1 test');
}
#[Before('moveToTestDir')]
public function checkEnvParamsPassed(CliGuy $I)
{
$I->executeCommand('run --no-exit dummy');
$I->seeInShellOutput('FAILURES');
$I->seeInShellOutput("Failed asserting that an array contains 'val1'");
}
#[Before('moveToTestDir')]
public function checkParamsPassedInSelf(CliGuy $I)
{
$I->executeCommand('run -c codeception_self.yml dummy');
$I->seeInShellOutput('OK (1 test');
}
#[Before('moveToTestDir')]
public function checkXmlParamsPassed(CliGuy $I)
{
$I->executeCommand('run -c codeception_xml.yml dummy');
$I->seeInShellOutput('OK (1 test');
}
#[Before('moveToTestDir')]
public function checkNonStringParamsAreEncodedProperly(CliGuy $I)
{
$I->executeCommand('run -c codeception_yaml.yml complex');
$I->seeInShellOutput('OK (1 test');
}
}