@@ -16,6 +16,13 @@ class SuiteGenerationTest extends TestCase
16
16
const RESOURCES_DIR = TESTS_BP . DIRECTORY_SEPARATOR . 'verification ' . DIRECTORY_SEPARATOR . 'Resources ' ;
17
17
const CONFIG_YML_FILE = FW_BP . DIRECTORY_SEPARATOR . SuiteGenerator::YAML_CODECEPTION_CONFIG_FILENAME ;
18
18
19
+ const MANIFEST_RESULTS = [
20
+ 'SampleSuite3Cest.php:IncludeTest ' ,
21
+ 'SampleSuite5Cest.php:additionalTest ' ,
22
+ 'SampleSuiteCest.php:IncludeTest ' ,
23
+ 'SampleSuite4Cest.php:IncludeTest '
24
+ ];
25
+
19
26
private static $ YML_EXISTS_FLAG = false ;
20
27
private static $ TEST_GROUPS = [];
21
28
@@ -45,18 +52,34 @@ public function testSuiteGeneration1()
45
52
$ yml = Yaml::parse (file_get_contents (self ::CONFIG_YML_FILE ));
46
53
$ this ->assertArrayHasKey ($ groupName , $ yml ['groups ' ]);
47
54
48
- // Validate test manifest contents
49
- $ actualManifest = TESTS_BP .
55
+ $ suiteResultBaseDir = TESTS_BP .
50
56
DIRECTORY_SEPARATOR .
51
57
"verification " .
52
58
DIRECTORY_SEPARATOR .
53
59
"_generated " .
54
60
DIRECTORY_SEPARATOR .
55
61
$ groupName .
56
- DIRECTORY_SEPARATOR .
57
- TestManifest::TEST_MANIFEST_FILENAME ;
58
- $ expectedManifest = self ::RESOURCES_DIR . DIRECTORY_SEPARATOR . "TestSuiteGeneration1.txt " ;
59
- $ this ->assertFileEquals ($ expectedManifest , $ actualManifest , '' , true , true );
62
+ DIRECTORY_SEPARATOR ;
63
+
64
+ // Validate test manifest contents
65
+ $ actualManifest = $ suiteResultBaseDir . TestManifest::TEST_MANIFEST_FILENAME ;
66
+ $ actualTestReferences = explode (PHP_EOL , file_get_contents ($ actualManifest ));
67
+
68
+ for ($ i = 0 ; $ i < count ($ actualTestReferences ); $ i ++) {
69
+ if (empty ($ actualTestReferences [$ i ])) {
70
+ continue ;
71
+ }
72
+
73
+ $ this ->assertStringEndsWith (self ::MANIFEST_RESULTS [$ i ], $ actualTestReferences [$ i ]);
74
+ $ this ->assertNotFalse (strpos ($ actualTestReferences [$ i ], $ groupName ));
75
+ }
76
+
77
+ // Validate expected php files exist
78
+ foreach (self ::MANIFEST_RESULTS as $ expectedTestReference ) {
79
+ $ cestName = explode (": " , $ expectedTestReference , 2 );
80
+ $ this ->assertFileExists ($ suiteResultBaseDir . $ cestName [0 ]);
81
+ }
82
+
60
83
}
61
84
62
85
public static function tearDownAfterClass ()
0 commit comments