From 1ae49d21969bd7c1ad86fd0765b62d4daa41fa20 Mon Sep 17 00:00:00 2001 From: Phil Tyler Date: Thu, 5 Dec 2024 12:51:48 -0800 Subject: [PATCH] adjust test and restore dropped default --- includes/class-solrpower-api.php | 7 ++++--- tests/behat/solr-power.feature | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/class-solrpower-api.php b/includes/class-solrpower-api.php index 9886c5d8..f7d7d49c 100644 --- a/includes/class-solrpower-api.php +++ b/includes/class-solrpower-api.php @@ -129,7 +129,8 @@ function submit_schema() { * wp-content/uploads/solr-for-wordpress-on-pantheon/schema.xml * and can be overridden with the filter 'solr_power_customer_schema_file_path'. */ - + + $schema = SOLR_POWER_PATH . '/schema.xml'; $custom_schema_file_path = self::custom_schema_file_path(); if ( file_exists( $custom_schema_file_path ) ) { @@ -149,11 +150,11 @@ function submit_schema() { } if ( ! file_exists( $schema ) ) { - return $schema . ' does not exist.'; + return "Schema '" . $schema . "' does not exist."; } if ( ! file_exists( $client_cert ) ) { - return $client_cert . ' does not exist.'; + return "Client cert '" . $client_cert . "' does not exist."; } $file = fopen( $schema, 'r' ); diff --git a/tests/behat/solr-power.feature b/tests/behat/solr-power.feature index 2b8a9ecc..f759fac8 100644 --- a/tests/behat/solr-power.feature +++ b/tests/behat/solr-power.feature @@ -11,11 +11,11 @@ Feature: Solr Power plugin When I go to "/wp-admin/options-general.php?page=solr-power" When I should see "Successful" in the "#solr_info" element - Scenario: I see the default schema path in the action dashboard - When I go to "/wp-admin/admin.php?page=solr-power#top#solr_action" - Then I should see "To use a custom schema.xml, upload it to the /code/wp-content/uploads/solr-for-wordpress-on-pantheon/ directory." in the "#solr_action" element - Scenario: I can submit default schema When I go to "/wp-admin/admin.php?page=solr-power#top#solr_action" And I press "s4wp_repost_schema" Then I should see "Schema Upload Success: 200" in the "#message" element + + Scenario: I see the default schema path in the action dashboard + When I go to "/wp-admin/admin.php?page=solr-power#top#solr_action" + Then I should see "To use a custom schema.xml, upload it to the /code/wp-content/uploads/solr-for-wordpress-on-pantheon/ directory."