Repository navigation
Expand file tree
/
Copy pathGenerateSuiteCest.php
More file actions
43 lines (38 loc) · 1.65 KB
/
Copy pathGenerateSuiteCest.php
File metadata and controls
43 lines (38 loc) · 1.65 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
<?php
declare(strict_types=1);
final class GenerateSuiteCest
{
public function generateSimpleSuite(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('generate:suite house HouseGuy');
$I->seeFileFound('house.suite.yml', 'tests');
$I->expect('actor class is generated');
$I->seeInThisFile('actor: HouseGuy');
$I->seeInThisFile('- \Helper\House');
$I->seeFileFound('House.php', 'tests/_support/Helper');
$I->seeInThisFile('namespace Helper;');
$I->seeDirFound('tests/house');
$I->expect('suite is not created due to dashes');
$I->executeCommand('generate:suite invalid-dash-suite', false);
$I->seeResultCodeIs(1);
$I->seeInShellOutput('contains invalid characters');
}
public function generateSuiteWithCustomConfig(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('bootstrap --empty src/FooBar --namespace FooBar');
$I->executeCommand('generate:suite house HouseGuy -c src/FooBar');
$I->seeDirFound('src/FooBar/tests/house');
$I->seeFileFound('house.suite.yml', 'src/FooBar/tests');
$I->expect('guy class is generated');
$I->seeInThisFile('actor: HouseGuy');
$I->seeInThisFile('- \FooBar\Helper\House');
$I->seeFileFound('House.php', 'src/FooBar/tests/_support/Helper');
$I->seeInThisFile('namespace FooBar\Helper;');
$I->expect('suite is not created due to dashes');
$I->executeCommand('generate:suite invalid-dash-suite', false);
$I->seeResultCodeIs(1);
$I->seeInShellOutput('contains invalid characters');
}
}