@@ -17,22 +17,20 @@ protected function stepAhoyCli(): void {
1717 $ this ->logStepStart ();
1818
1919 $ this ->logSubstep ('Testing ahoy cli command ' );
20- $ this ->processRun ('ahoy cli "echo Test from inside of the container" ' );
21- $ this -> assertProcessSuccessful ();
22- $ this -> assertProcessOutputNotContains ( ' Containers are not running. ' );
23- $ this -> assertProcessOutputContains ( ' Test from inside of the container ' );
20+ $ this ->cmd ('ahoy cli "echo Test from inside of the container" ' , [
21+ ' ! Containers are not running. ' ,
22+ ' * Test from inside of the container ' ,
23+ ] );
2424
2525 $ this ->logSubstep ('Testing environment variable filtering ' );
2626 // Set test environment variables.
2727 putenv ('DRUPAL_UNFILTERED_VAR=drupalvar ' );
2828 putenv ('OTHER_FILTERED_VAR=othervar ' );
2929
30- $ this ->processRun ('ahoy cli "echo $DRUPAL_UNFILTERED_VAR" ' , env: [
30+ $ this ->cmd ('ahoy cli "echo $DRUPAL_UNFILTERED_VAR" ' , [ ' * drupalvar ' , ' ! othervar ' ] , env: [
3131 'DRUPAL_UNFILTERED_VAR ' => 'drupalvar ' ,
3232 'OTHER_FILTERED_VAR ' => 'othervar ' ,
3333 ]);
34- $ this ->assertProcessOutputContains ('drupalvar ' );
35- $ this ->assertProcessOutputNotContains ('othervar ' );
3634
3735 $ this ->logStepFinish ();
3836 }
@@ -41,10 +39,10 @@ protected function stepAhoyComposer(): void {
4139 $ this ->logStepStart ();
4240
4341 $ this ->logSubstep ('Testing ahoy composer command ' );
44- $ this ->processRun ('ahoy composer about ' );
45- $ this -> assertProcessSuccessful ();
46- $ this -> assertProcessOutputContains ( 'Composer - Dependency Manager for PHP - version 2. ' );
47- $ this -> assertProcessOutputContains ( ' Composer is a dependency manager tracking local dependencies of your projects and libraries. ' );
42+ $ this ->cmd ('ahoy composer about ' , [
43+ ' Composer - Dependency Manager for PHP - version 2. ' ,
44+ 'Composer is a dependency manager tracking local dependencies of your projects and libraries. ' ,
45+ ] );
4846
4947 $ this ->logStepFinish ();
5048 }
@@ -53,9 +51,7 @@ protected function stepAhoyDrush(): void {
5351 $ this ->logStepStart ();
5452
5553 $ this ->logSubstep ('Testing ahoy drush command ' );
56- $ this ->processRun ('ahoy drush st ' );
57- $ this ->assertProcessSuccessful ();
58- $ this ->assertProcessOutputNotContains ('Containers are not running. ' );
54+ $ this ->cmd ('ahoy drush st ' , '! Containers are not running. ' );
5955
6056 $ this ->logStepFinish ();
6157 }
@@ -64,17 +60,22 @@ protected function stepAhoyInfo(string $webroot = 'web', string $db_image = ''):
6460 $ this ->logStepStart ();
6561
6662 $ this ->logSubstep ('Testing ahoy info command ' );
67- $ this ->processRun ('ahoy info ' );
68- $ this ->assertProcessSuccessful ();
69- $ this ->assertProcessOutputContains ('Project name : star_wars ' );
70- $ this ->assertProcessOutputContains ('Docker Compose project name : star_wars ' );
71- $ this ->assertProcessOutputContains ('Site local URL : http://star_wars.docker.amazee.io ' );
72- $ this ->assertProcessOutputContains ('Path to web root : /app/ ' . $ webroot );
73- $ this ->assertProcessOutputContains ('DB host : database ' );
74- $ this ->assertProcessOutputContains ('DB username : drupal ' );
75- $ this ->assertProcessOutputContains ('DB password : drupal ' );
76- $ this ->assertProcessOutputContains ('DB port : 3306 ' );
77- $ this ->assertProcessOutputContains ('DB port on host : ' );
63+ $ this ->cmd ('ahoy info ' , [
64+ '* Project name : star_wars ' ,
65+ '* Docker Compose project name : star_wars ' ,
66+ '* Site local URL : http://star_wars.docker.amazee.io ' ,
67+ '* Path to web root : /app/ ' . $ webroot ,
68+ '* DB host : database ' ,
69+ '* DB username : drupal ' ,
70+ '* DB password : drupal ' ,
71+ '* DB port : 3306 ' ,
72+ '* DB port on host : ' ,
73+ '* Solr URL on host : ' ,
74+ '* Selenium VNC URL on host : ' ,
75+ '* Mailhog URL : http://mailhog.docker.amazee.io/ ' ,
76+ "* Xdebug : Disabled ('ahoy debug' to enable) " ,
77+ '! Containers are not running. ' ,
78+ ]);
7879
7980 if (!empty ($ db_image )) {
8081 $ this ->assertProcessOutputContains ('DB-in-image : ' . $ db_image );
@@ -83,22 +84,14 @@ protected function stepAhoyInfo(string $webroot = 'web', string $db_image = ''):
8384 $ this ->assertProcessOutputNotContains ('DB-in-image : ' . $ db_image );
8485 }
8586
86- $ this ->assertProcessOutputContains ('Solr URL on host : ' );
87- $ this ->assertProcessOutputContains ('Selenium VNC URL on host : ' );
88- $ this ->assertProcessOutputContains ('Mailhog URL : http://mailhog.docker.amazee.io/ ' );
89- $ this ->assertProcessOutputContains ("Xdebug : Disabled ('ahoy debug' to enable) " );
90- $ this ->assertProcessOutputNotContains ('Containers are not running. ' );
91-
9287 $ this ->logStepFinish ();
9388 }
9489
9590 protected function stepAhoyContainerLogs (): void {
9691 $ this ->logStepStart ();
9792
9893 $ this ->logSubstep ('Testing ahoy logs command ' );
99- $ this ->processRun ('ahoy logs ' );
100- $ this ->assertProcessSuccessful ();
101- $ this ->assertProcessOutputNotContains ('Containers are not running. ' );
94+ $ this ->cmd ('ahoy logs ' , '! Containers are not running. ' );
10295
10396 $ this ->logStepFinish ();
10497 }
@@ -107,9 +100,7 @@ protected function stepAhoyLogin(): void {
107100 $ this ->logStepStart ();
108101
109102 $ this ->logSubstep ('Testing ahoy login command ' );
110- $ this ->processRun ('ahoy login ' );
111- $ this ->assertProcessSuccessful ();
112- $ this ->assertProcessOutputNotContains ('Containers are not running. ' );
103+ $ this ->cmd ('ahoy login ' , '! Containers are not running. ' );
113104
114105 $ this ->logStepFinish ();
115106 }
0 commit comments