Skip to content

Commit 7ea4992

Browse files
committed
Update tests
Signed-off-by: Kirtan Gajjar <[email protected]>
1 parent ebc493c commit 7ea4992

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,21 @@ public function requestOnWithResolveOptionShouldContainFollowingHeaders($host, $
249249
*/
250250
public static function cleanup(AfterFeatureScope $scope)
251251
{
252-
exec("sudo bin/ee site delete hello.test --yes");
253-
exec("sudo bin/ee site delete example.test --yes");
254-
exec("sudo bin/ee site delete www.example1.test --yes");
255-
exec("sudo bin/ee site delete example2.test --yes");
256-
exec("sudo bin/ee site delete www.example3.test --yes");
257-
252+
$test_sites = [
253+
'hello.test',
254+
'example.test',
255+
'www.example1.test',
256+
'example2.test',
257+
'www.example3.test',
258+
];
259+
260+
$result = EE::launch( 'sudo bin/ee site list --format=text',false, true );
261+
$running_sites = explode( "\n", $result->stdout );
262+
$sites_to_delete = array_intersect( $test_sites, $running_sites );
263+
264+
foreach ( $sites_to_delete as $site ) {
265+
exec("sudo bin/ee site delete $site --yes" );
266+
}
258267

259268
if(file_exists('ee.phar')) {
260269
unlink('ee.phar');

0 commit comments

Comments
 (0)