From 778d46f68b2ccb7b9ef337e157f2bde445736050 Mon Sep 17 00:00:00 2001 From: Abhijit Rakas Date: Tue, 4 Dec 2018 15:57:25 +0530 Subject: [PATCH 1/3] Add more behat test suits --- .travis.yml | 40 ++++ ci/prepare.sh | 32 ++++ features/bootstrap/FeatureContext.php | 258 ++++++++++++++++++++++++++ features/bootstrap/support.php | 206 ++++++++++++++++++++ features/site.feature | 243 ++++++++++++++++++++++++ 5 files changed, 779 insertions(+) create mode 100644 .travis.yml create mode 100755 ci/prepare.sh create mode 100644 features/bootstrap/FeatureContext.php create mode 100644 features/bootstrap/support.php create mode 100644 features/site.feature diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..314fa3f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +sudo: required + +language: php +php: 7.0 + +env: + global: + - TEST_COMMAND=$(echo $TRAVIS_REPO_SLUG | cut -d/ -f 2) # Get command name to be tested + +before_script: + - sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + - | + # Remove Xdebug for a huge performance increase: + if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then + phpenv config-rm xdebug.ini + else + echo "xdebug.ini does not exist" + fi + - ./ci/prepare.sh + +script: + - cd "$TRAVIS_BUILD_DIR/../easyengine" + - sudo ./vendor/bin/behat + +after_script: + - cat /opt/easyengine/logs/ee.log + +cache: + directories: + - $HOME/.composer/cache + +notifications: + email: + on_success: never + on_failure: change + +addons: + apt: + packages: + - docker-ce diff --git a/ci/prepare.sh b/ci/prepare.sh new file mode 100755 index 0000000..9c4387e --- /dev/null +++ b/ci/prepare.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# called by Travis CI + +# install dependencies +wget -qO ee https://rt.cx/ee4beta && sudo bash ee +rm ee + +# Setup EE develop repo +cd .. +git clone https://github.com/EasyEngine/easyengine.git easyengine --depth=1 +cd easyengine + +# Copy tests to EE repo +rm -r features +cp -R ../$TEST_COMMAND/features . + +# Update repo branches +if [[ "$TRAVIS_BRANCH" != "master" ]]; then + sed -i 's/\(easyengine\/.*\):\ \".*\"/\1:\ \"dev-develop\"/' composer.json +fi + +# Install composer dependencies and update them for tests +composer update + +# Place the command inside EE repo +sudo rm -rf vendor/easyengine/$TEST_COMMAND +cp -R ../$TEST_COMMAND vendor/easyengine/ + +# Create phar and test it +php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quite > /dev/null +sudo php easyengine.phar cli info \ No newline at end of file diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php new file mode 100644 index 0000000..fcfbb9e --- /dev/null +++ b/features/bootstrap/FeatureContext.php @@ -0,0 +1,258 @@ +init_logger(); +/* End. Loading required files to enable EE::launch() in tests. */ + +use Behat\Behat\Context\Context; +use Behat\Behat\Hook\Scope\AfterFeatureScope; +use Behat\Behat\Hook\Scope\AfterScenarioScope; + +use Behat\Gherkin\Node\PyStringNode, + Behat\Gherkin\Node\TableNode; + +define( 'EE_SITE_ROOT', EE_ROOT_DIR . '/sites' ); + +class FeatureContext implements Context +{ + public $command; + public $webroot_path; + public $ee_path; + + /** + * Initializes context. + */ + public function __construct() + { + $this->commands = []; + $this->ee_path = getcwd(); + } + + /** + * @Given ee phar is generated + */ + public function eePharIsPresent() + { + // Checks if phar already exists, replaces it + if( file_exists( 'ee-old.phar' ) ) { + // Below exec call is required as currenly `ee cli update` is ran with root + // which updates ee.phar with root privileges. + exec( "sudo rm ee.phar" ); + copy( 'ee-old.phar','ee.phar' ); + return 0; + } + exec( "php -dphar.readonly=0 utils/make-phar.php ee.phar", $output, $return_status ); + if ( 0 !== $return_status ) { + throw new Exception( "Unable to generate phar" . $return_status ); + } + + // Cache generaed phar as it is expensive to generate one + copy( 'ee.phar','ee-old.phar' ); + } + + /** + * @Given :command is installed + */ + public function isInstalled( $command ) + { + exec( "type " . $command, $output, $return_status ); + if ( 0 !== $return_status ) { + throw new Exception( $command . " is not installed! Exit code is:" . $return_status ); + } + } + + /** + * @When /I run '(.*)'|"(.*)"/ + */ + public function iRun( $command ) + { + $this->commands[] = EE::launch($command, false, true); + } + + /** + * @When I try :command + */ + public function iTry( $command ) + { + $this->commands[] = EE::launch($command, false, true); + } + + /** + * @Then After delay of :time seconds + */ + public function afterDelayOfSeconds( $time ) + { + sleep( $time ); + } + + /** + * @Then /(STDOUT|STDERR) should return exactly/ + */ + public function stdoutShouldReturnExactly( $output_stream, PyStringNode $expected_output ) + { + $command_output = $output_stream === "STDOUT" ? $this->commands[0]->stdout : $this->commands[0]->stderr; + + $command_output = str_replace(["\033[1;31m","\033[0m"],'',$command_output); + + if ( $expected_output->getRaw() !== trim($command_output)) { + throw new Exception("Actual output is:\n" . $command_output); + } + } + + /** + * @Then /(STDOUT|STDERR) should return something like/ + */ + public function stdoutShouldReturnSomethingLike( $output_stream, PyStringNode $expected_output ) + { + $command_output = $output_stream === "STDOUT" ? $this->commands[0]->stdout : $this->commands[0]->stderr; + + $expected_out = isset( $expected_output->getStrings()[0] ) ? $expected_output->getStrings()[0] : ''; + if ( strpos( $command_output, $expected_out ) === false ) { + throw new Exception( "Actual output is:\n" . $command_output ); + } + } + + /** + * @Then The ee should have admin-tools directory in root + */ + public function theEEShouldHaveToolsDir() + { + if ( ! file_exists( EE_ROOT_DIR . '/admin-tools' ) ) { + throw new Exception( "The admin-tools directory has not been created!" ); + } + } + + /** + * @Then The admin-tools should have index file + */ + public function theAdminToolsShouldHaveIndexFile() + { + if ( ! file_exists( EE_ROOT_DIR . '/admin-tools/index.php' ) ) { + throw new Exception( "Admin Tools data not found!" ); + } + } + + /** + * @Then The site :site should have index file + */ + public function theSiteShouldHaveIndexFile( $site ) + { + if ( ! file_exists( EE_SITE_ROOT . '/' . $site . "/app/htdocs/index.php" ) ) { + throw new Exception( "PHP site data not found!" ); + } + } + + /** + * @Then The site :site should have WordPress + */ + public function theSiteShouldHaveWordpress($site) + { + if ( ! file_exists( EE_SITE_ROOT . '/' . $site . "/app/wp-config.php" ) ) { + throw new Exception("WordPress data not found!"); + } + } + + /** + * @Then Request on :site should contain following headers: + */ + public function requestOnShouldContainFollowingHeaders( $site, TableNode $table ) + { + $url = 'http://' . $site; + + $ch = curl_init(); + + curl_setopt( $ch, CURLOPT_URL, $url ); + curl_setopt( $ch, CURLOPT_HEADER, true ); + curl_setopt( $ch, CURLOPT_NOBODY, true ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $ch, CURLOPT_VERBOSE, true ); + + $headers = curl_exec( $ch ); + + curl_close($ch); + + $rows = $table->getHash(); + + foreach ( $rows as $row ) { + if ( strpos( $headers, $row['header'] ) === false ) { + throw new Exception( "Unable to find " . $row['header'] . "\nActual output is : " . $headers ); + } + } + } + + /** + * @AfterScenario + */ + public function cleanupScenario( AfterScenarioScope $scope ) + { + $this->commands = []; + chdir( $this->ee_path ); + } + + /** + * @AfterFeature + */ + public static function cleanup( AfterFeatureScope $scope ) + { + $test_sites = [ + 'php.test', + 'wp.test' + ]; + + $result = EE::launch( 'sudo bin/ee site list --format=text', false, true ); + $running_sites = explode( "\n", $result->stdout ); + $sites_to_delete = array_intersect( $test_sites, $running_sites ); + + foreach ( $sites_to_delete as $site ) { + exec( "sudo bin/ee site delete $site --yes" ); + } + + if( file_exists( 'ee.phar' ) ) { + unlink( 'ee.phar' ); + } + + if( file_exists( 'ee-old.phar' ) ) { + unlink( 'ee-old.phar' ); + } + } + +} diff --git a/features/bootstrap/support.php b/features/bootstrap/support.php new file mode 100644 index 0000000..7f1d528 --- /dev/null +++ b/features/bootstrap/support.php @@ -0,0 +1,206 @@ + $value ) { + if ( ! compareContents( $value, $actual->$name ) ) { + return false; + } + } + } else if ( is_array( $expected ) ) { + foreach ( $expected as $key => $value ) { + if ( ! compareContents( $value, $actual[$key] ) ) { + return false; + } + } + } else { + return $expected === $actual; + } + + return true; +} + +/** + * Compare two strings containing JSON to ensure that @a $actualJson contains at + * least what the JSON string @a $expectedJson contains. + * + * @return whether or not @a $actualJson contains @a $expectedJson + * @retval true @a $actualJson contains @a $expectedJson + * @retval false @a $actualJson does not contain @a $expectedJson + * + * @param [in] $actualJson the JSON string to be tested + * @param [in] $expectedJson the expected JSON string + * + * Examples: + * expected: {'a':1,'array':[1,3,5]} + * + * 1 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: true + * + * 2 ) + * actual: {'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * element 'a' is missing from the root object + * + * 3 ) + * actual: {'a':0,'b':2,'c':3,'array':[1,2,3,4,5]} + * return: false + * the value of element 'a' is not 1 + * + * 4 ) + * actual: {'a':1,'b':2,'c':3,'array':[1,2,4,5]} + * return: false + * the contents of 'array' does not include 3 + */ +function checkThatJsonStringContainsJsonString( $actualJson, $expectedJson ) { + $actualValue = json_decode( $actualJson ); + $expectedValue = json_decode( $expectedJson ); + + if ( ! $actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} + +/** + * Compare two strings to confirm $actualCSV contains $expectedCSV + * Both strings are expected to have headers for their CSVs. + * $actualCSV must match all data rows in $expectedCSV + * + * @param string A CSV string + * @param array A nested array of values + * + * @return bool Whether $actualCSV contains $expectedCSV + */ +function checkThatCsvStringContainsValues( $actualCSV, $expectedCSV ) { + $actualCSV = array_map( 'str_getcsv', explode( PHP_EOL, $actualCSV ) ); + + if ( empty( $actualCSV ) ) { + return false; + } + + // Each sample must have headers + $actualHeaders = array_values( array_shift( $actualCSV ) ); + $expectedHeaders = array_values( array_shift( $expectedCSV ) ); + + // Each expectedCSV must exist somewhere in actualCSV in the proper column + $expectedResult = 0; + foreach ( $expectedCSV as $expected_row ) { + $expected_row = array_combine( $expectedHeaders, $expected_row ); + foreach ( $actualCSV as $actual_row ) { + + if ( count( $actualHeaders ) != count( $actual_row ) ) { + continue; + } + + $actual_row = array_intersect_key( array_combine( $actualHeaders, $actual_row ), $expected_row ); + if ( $actual_row == $expected_row ) { + $expectedResult ++; + } + } + } + + return $expectedResult >= count( $expectedCSV ); +} + +/** + * Compare two strings containing YAML to ensure that @a $actualYaml contains at + * least what the YAML string @a $expectedYaml contains. + * + * @return whether or not @a $actualYaml contains @a $expectedJson + * @retval true @a $actualYaml contains @a $expectedJson + * @retval false @a $actualYaml does not contain @a $expectedJson + * + * @param [in] $actualYaml the YAML string to be tested + * @param [in] $expectedYaml the expected YAML string + */ +function checkThatYamlStringContainsYamlString( $actualYaml, $expectedYaml ) { + $actualValue = Mustangostang\Spyc::YAMLLoad( $actualYaml ); + $expectedValue = Mustangostang\Spyc::YAMLLoad( $expectedYaml ); + + if ( ! $actualValue ) { + return false; + } + + return compareContents( $expectedValue, $actualValue ); +} diff --git a/features/site.feature b/features/site.feature new file mode 100644 index 0000000..235bd99 --- /dev/null +++ b/features/site.feature @@ -0,0 +1,243 @@ +Feature: Admin Tools Command + + Scenario: ee executable is command working correctly + Given 'bin/ee' is installed + When I run 'bin/ee' + Then STDOUT should return something like + """ + NAME + + ee + """ + + Scenario: Check admin-tools command is present + When I run 'bin/ee admin-tools' + Then STDOUT should return exactly + """ + usage: ee admin-tools disable [] [--force] + or: ee admin-tools enable [] [--force] + + See 'ee help admin-tools ' for more information on a specific command. + """ + + Scenario: Create php site + When I run 'bin/ee site create php.test --type=php' + Then After delay of 2 seconds + And The site 'php.test' should have index file + And Request on 'php.test' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Check admin-tools enable sub command is present + When I run 'bin/ee admin-tools enable' + Then STDERR should return something like + """ + Error: Could not find the site you wish to run admin-tools enable command on. + Either pass it as an argument: `ee admin-tools enable ` + or run `ee admin-tools enable` from inside the site folder. + """ + + Scenario: Enable admin-tools for PHP site + When I run 'bin/ee admin-tools enable php.test' + Then STDOUT should return exactly + """ + Global auth exists on admin-tools. Use `ee auth list global` to view credentials. + Success: admin-tools enabled for php.test site. + """ + And After delay of 5 seconds + And The ee should have admin-tools directory in root + And The admin-tools should have index file + And Request on 'php.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/ping/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Disable PHP site + When I run 'bin/ee site disable php.test' + Then STDOUT should return exactly + """ + Disabling site php.test. + Success: Site php.test disabled. + """ + And Request on 'php.test' should contain following headers: + | header | + | HTTP/1.1 503 Service Temporarily Unavailable | + + Scenario: Enable PHP site and check ee-admin should Work as expected + When I run 'bin/ee site enable php.test' + Then STDOUT should return exactly + """ + Enabling site php.test. + Success: Site php.test enabled. + Running post enable configurations. + Starting site's services. + Global auth exists on admin-tools. Use `ee auth list global` to view credentials. + Success: admin-tools enabled for php.test site. + Success: Post enable configurations complete. + """ + And After delay of 5 seconds + And Request on 'php.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/ping/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'php.test/ee-admin/status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Disable admin-tools for PHP site + When I run 'bin/ee admin-tools disable php.test' + Then STDOUT should return exactly + """ + Success: admin-tools disabled for php.test site. + """ + And After delay of 5 seconds + And Request on 'php.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 403 Forbidden | + And Request on 'php.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 404 Not Found | + And Request on 'php.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 404 Not Found | + And Request on 'php.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 403 Forbidden | + + Scenario: Create WordPress site + When I run 'bin/ee site create wp.test --type=wp' + Then After delay of 2 seconds + And The site 'wp.test' should have WordPress + And Request on 'wp.test' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Enable admin-tools for WordPress site + When I run 'bin/ee admin-tools enable wp.test' + Then STDOUT should return exactly + """ + Global auth exists on admin-tools. Use `ee auth list global` to view credentials. + Success: admin-tools enabled for wp.test site. + """ + And After delay of 5 seconds + And Request on 'wp.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/pra/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/ping/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Disable WordPress site + When I run 'bin/ee site disable wp.test' + Then STDOUT should return exactly + """ + Disabling site wp.test. + Success: Site wp.test disabled. + """ + And Request on 'wp.test' should contain following headers: + | header | + | HTTP/1.1 503 Service Temporarily Unavailable | + + Scenario: Enable WordPress site and check ee-admin should Work as expected + When I run 'bin/ee site enable wp.test' + Then STDOUT should return exactly + """ + Enabling site wp.test. + Success: Site wp.test enabled. + Running post enable configurations. + Starting site's services. + Global auth exists on admin-tools. Use `ee auth list global` to view credentials. + Success: admin-tools enabled for wp.test site. + Success: Post enable configurations complete. + """ + And After delay of 5 seconds + And Request on 'wp.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/ping/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | + + Scenario: Disable admin-tools for WordPress site + When I run 'bin/ee admin-tools disable wp.test' + Then STDOUT should return exactly + """ + Success: admin-tools disabled for wp.test site. + """ + And After delay of 5 seconds + And Request on 'wp.test/ee-admin/' should contain following headers: + | header | + | HTTP/1.1 403 Forbidden | + And Request on 'wp.test/ee-admin/opcache-gui.php' should contain following headers: + | header | + | HTTP/1.1 404 Not Found | + And Request on 'wp.test/ee-admin/phpinfo.php' should contain following headers: + | header | + | HTTP/1.1 404 Not Found | + And Request on 'wp.test/ee-admin/pma/' should contain following headers: + | header | + | HTTP/1.1 403 Forbidden | From c26560a9434a9e1e281f007907d95dfe08c5e13a Mon Sep 17 00:00:00 2001 From: Abhijit Rakas Date: Tue, 4 Dec 2018 16:07:02 +0530 Subject: [PATCH 2/3] Fix site fix admin-tools enable test --- features/site.feature | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/features/site.feature b/features/site.feature index 235bd99..8fb41ea 100644 --- a/features/site.feature +++ b/features/site.feature @@ -42,6 +42,17 @@ Feature: Admin Tools Command Then STDOUT should return exactly """ Global auth exists on admin-tools. Use `ee auth list global` to view credentials. + Installing admin-tools. This may take some time. + Installing index + Success: Installed index successfully. + Installing phpinfo + Success: Installed phpinfo successfully. + Installing pma + Success: Installed pma successfully. + Installing pra + Success: Installed pra successfully. + Installing opcache + Success: Installed opcache successfully. Success: admin-tools enabled for php.test site. """ And After delay of 5 seconds From 5c30ebc66e7b8b1282847af47d9b4f3f206e81fc Mon Sep 17 00:00:00 2001 From: Abhijit Rakas Date: Tue, 4 Dec 2018 16:26:14 +0530 Subject: [PATCH 3/3] Change behat test suits order --- features/site.feature | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/features/site.feature b/features/site.feature index 8fb41ea..b995980 100644 --- a/features/site.feature +++ b/features/site.feature @@ -165,9 +165,6 @@ Feature: Admin Tools Command And Request on 'wp.test/ee-admin/' should contain following headers: | header | | HTTP/1.1 200 OK | - And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: - | header | - | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/opcache-gui.php' should contain following headers: | header | | HTTP/1.1 200 OK | @@ -177,15 +174,18 @@ Feature: Admin Tools Command And Request on 'wp.test/ee-admin/pra/' should contain following headers: | header | | HTTP/1.1 200 OK | - And Request on 'wp.test/ee-admin/ping/' should contain following headers: + And Request on 'wp.test/ee-admin/pma/' should contain following headers: | header | | HTTP/1.1 200 OK | - And Request on 'wp.test/ee-admin/pma/' should contain following headers: + And Request on 'wp.test/ee-admin/ping/' should contain following headers: | header | | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/status/' should contain following headers: | header | | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | Scenario: Disable WordPress site When I run 'bin/ee site disable wp.test' @@ -214,24 +214,27 @@ Feature: Admin Tools Command And Request on 'wp.test/ee-admin/' should contain following headers: | header | | HTTP/1.1 200 OK | - And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: - | header | - | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/opcache-gui.php' should contain following headers: | header | | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/phpinfo.php' should contain following headers: | header | | HTTP/1.1 200 OK | - And Request on 'wp.test/ee-admin/ping/' should contain following headers: + And Request on 'wp.test/ee-admin/pra/' should contain following headers: | header | | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/pma/' should contain following headers: | header | | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/ping/' should contain following headers: + | header | + | HTTP/1.1 200 OK | And Request on 'wp.test/ee-admin/status/' should contain following headers: | header | | HTTP/1.1 200 OK | + And Request on 'wp.test/ee-admin/nginx_status/' should contain following headers: + | header | + | HTTP/1.1 200 OK | Scenario: Disable admin-tools for WordPress site When I run 'bin/ee admin-tools disable wp.test' @@ -249,6 +252,9 @@ Feature: Admin Tools Command And Request on 'wp.test/ee-admin/phpinfo.php' should contain following headers: | header | | HTTP/1.1 404 Not Found | + And Request on 'wp.test/ee-admin/pra/' should contain following headers: + | header | + | HTTP/1.1 403 Forbidden | And Request on 'wp.test/ee-admin/pma/' should contain following headers: | header | | HTTP/1.1 403 Forbidden |