@@ -93,98 +93,12 @@ public function stdoutShouldReturnSomethingLike($output_stream, PyStringNode $ex
9393 }
9494 }
9595
96- /**
97- * @Then The :site db entry should be removed
98- */
99- public function theDbEntryShouldBeRemoved ($ site )
100- {
101- $ out = shell_exec ("sudo bin/ee site list " );
102- if (strpos ($ out , $ site ) !== false ) {
103- throw new Exception ("$ site db entry not been removed! " );
104- }
105-
106- }
107-
108- /**
109- * @Then The :site webroot should be removed
110- */
111- public function theWebrootShouldBeRemoved ($ site )
112- {
113- if (file_exists (getenv ('HOME ' ) . "/ee-sites/ " . $ site )) {
114- throw new Exception ("Webroot has not been removed! " );
115- }
116- }
117-
118- /**
119- * @Then Following containers of site :site should be removed:
120- */
121- public function followingContainersOfSiteShouldBeRemoved ($ site , TableNode $ table )
122- {
123- $ containers = $ table ->getHash ();
124- $ site_name = implode (explode ('. ' , $ site ));
125-
126- foreach ($ containers as $ container ) {
127-
128- $ sevice = $ container ['container ' ];
129- $ container_name = $ site_name . '_ ' . $ sevice . '_1 ' ;
130-
131- exec ("docker inspect -f '{{.State.Running}}' $ container_name > /dev/null 2>&1 " , $ exec_out , $ return );
132- if (!$ return ) {
133- throw new Exception ("$ container_name has not been removed! " );
134- }
135- }
136- }
137-
138- /**
139- * @Then The site :site should have webroot
140- */
141- public function theSiteShouldHaveWebroot ($ site )
142- {
143- if (!file_exists (getenv ('HOME ' ) . "/ee-sites/ " . $ site )) {
144- throw new Exception ("Webroot has not been created! " );
145- }
146- }
147-
148- /**
149- * @Then The site :site should have WordPress
150- */
151- public function theSiteShouldHaveWordpress ($ site )
152- {
153- if (!file_exists (getenv ('HOME ' ) . "/ee-sites/ " . $ site . "/app/src/wp-config.php " )) {
154- throw new Exception ("WordPress data not found! " );
155- }
156- }
157-
158- /**
159- * @Then Request on :site should contain following headers:
160- */
161- public function requestOnShouldContainFollowingHeaders ($ site , TableNode $ table )
162- {
163- $ url = 'http:// ' . $ site ;
164-
165- $ ch = curl_init ();
166- curl_setopt ($ ch , CURLOPT_URL , $ url );
167- curl_setopt ($ ch , CURLOPT_HEADER , true );
168- curl_setopt ($ ch , CURLOPT_NOBODY , true );
169- curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , true );
170- $ headers = curl_exec ($ ch );
171- curl_close ($ ch );
172-
173- $ rows = $ table ->getHash ();
174-
175- foreach ($ rows as $ row ) {
176- if (strpos ($ headers , $ row ['header ' ]) === false ) {
177- throw new Exception ("Unable to find " . $ row ['header ' ] . "\nActual output is : " . $ headers );
178- }
179- }
180- }
181-
96+
18297 /**
18398 * @AfterFeature
18499 */
185100 public static function cleanup (AfterFeatureScope $ scope )
186101 {
187- exec ("sudo bin/ee site delete hello.test " );
188102 if (file_exists ('ee.phar ' )) {
189103 unlink ('ee.phar ' );
190104 }
0 commit comments