Skip to content

Commit

Permalink
adjust test and restore dropped default
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Dec 5, 2024
1 parent 32570ca commit 1ae49d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions includes/class-solrpower-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand All @@ -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' );
Expand Down
8 changes: 4 additions & 4 deletions tests/behat/solr-power.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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."

0 comments on commit 1ae49d2

Please sign in to comment.