File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -405,6 +405,9 @@ public static function cleanup(AfterFeatureScope $scope)
405405 'www.example3.test ' ,
406406 'labels.test ' ,
407407 'wpcache.test ' ,
408+ 'wp-local-db.test ' ,
409+ 'wp-local-redis.test ' ,
410+ 'wp-local-db-redis.test '
408411 ];
409412
410413 $ result = EE ::launch ( 'sudo bin/ee site list --format=text ' ,false , true );
@@ -422,4 +425,31 @@ public static function cleanup(AfterFeatureScope $scope)
422425 unlink ('ee-old.phar ' );
423426 }
424427 }
428+
429+ /**
430+ * @Then Check global redis cache for :site
431+ */
432+ public function checkGlobalRedisCacheOfSite ($ site )
433+ {
434+ exec ("docker exec -it ee-global-redis redis-cli set 'easyengine' 'rock' " );
435+ $ output = exec ("docker exec -it ee-global-redis redis-cli get 'easyengine' " );
436+ if ( '"rock" ' !== $ output ) {
437+ throw new Exception ("Global redis not working for $ site site. Getting ' $ output' instead of 'rock' " );
438+ }
439+ exec ("docker exec -it ee-global-redis redis-cli del 'easyengine' " );
440+ }
441+
442+ /**
443+ * @Then Check local redis cache for :site
444+ */
445+ public function checkLocalRedisCacheOfSite ($ site )
446+ {
447+ $ site_root_folder = EE_SITE_ROOT . '/ ' . $ site ;
448+ exec ("cd $ site_root_folder && docker-compose exec redis redis-cli set 'easyengine' 'rock' " );
449+ $ output = exec ("cd $ site_root_folder && docker-compose exec redis redis-cli get 'easyengine' " );
450+ if ( '"rock" ' !== $ output ) {
451+ throw new Exception ("Local redis not working for $ site site. Getting ' $ output' instead of 'rock'. " );
452+ }
453+ exec ("cd $ site_root_folder && docker-compose exec redis redis-cli del 'easyengine' " );
454+ }
425455}
Original file line number Diff line number Diff line change @@ -188,3 +188,33 @@ Feature: Site Command
188188 | db |
189189 | redis |
190190 | phpmyadmin |
191+
192+ Scenario : Create WordPress site with local DB and global redis
193+ When I run 'bin/ee site create wp-local-db.test --cache --type=wp --local-db'
194+ Then After delay of 5 seconds
195+ And The site 'wp-local-db.test' should have webroot
196+ And The site 'wp-local-db.test' should have WordPress
197+ And Request on 'wp-local-db.test' should contain following headers:
198+ | header |
199+ | HTTP /1 .1 200 OK |
200+ And Check global redis cache for 'wp-local-db.test'
201+
202+ Scenario : Create WordPress site with local redis and global db
203+ When I run 'bin/ee site create wp-local-redis.test --cache --type=wp --with-local-redis'
204+ Then After delay of 5 seconds
205+ And The site 'wp-local-redis.test' should have webroot
206+ And The site 'wp-local-redis.test' should have WordPress
207+ And Request on 'wp-local-redis.test' should contain following headers:
208+ | header |
209+ | HTTP /1 .1 200 OK |
210+ And Check local redis cache for 'wp-local-redis.test'
211+
212+ Scenario : Create WordPress site with local DB and local redis
213+ When I run 'bin/ee site create wp-local-db-redis.test --cache --type=wp --local-db --with-local-redis'
214+ Then After delay of 5 seconds
215+ And The site 'wp-local-db-redis.test' should have webroot
216+ And The site 'wp-local-db-redis.test' should have WordPress
217+ And Request on 'wp-local-db-redis.test' should contain following headers:
218+ | header |
219+ | HTTP /1 .1 200 OK |
220+ And Check local redis cache for 'wp-local-db-redis.test'
You can’t perform that action at this time.
0 commit comments