mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-76103 search: skip solr behat tests if solr is not installed
This commit is contained in:
parent
720bd60fc6
commit
635e852564
@ -27,6 +27,7 @@
|
||||
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
|
||||
|
||||
use Behat\Gherkin\Node\TableNode as TableNode;
|
||||
use Moodle\BehatExtension\Exception\SkippedException;
|
||||
|
||||
/**
|
||||
* Behat search-related step definitions.
|
||||
@ -146,4 +147,15 @@ class behat_search extends behat_base {
|
||||
public function i_update_the_global_search_index() {
|
||||
\core_search\manager::instance()->index(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* This step looks to see if Solr is installed or skip the rest of the scenario otherwise
|
||||
*
|
||||
* @Given /^solr is installed/
|
||||
*/
|
||||
public function solr_is_installed() {
|
||||
if (!function_exists('solr_get_version')) {
|
||||
throw new SkippedException('Skipping this scenario because Solr is not installed.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,8 @@ Feature: Select users when searching for user-created content
|
||||
I need to be able to add users to the select list in the search form
|
||||
|
||||
Background:
|
||||
Given the following config values are set as admin:
|
||||
Given solr is installed
|
||||
And the following config values are set as admin:
|
||||
| enableglobalsearch | 1 |
|
||||
| searchengine | solr |
|
||||
And the following "courses" exist:
|
||||
|
@ -93,7 +93,8 @@ Feature: Use global search interface
|
||||
@javascript
|
||||
Scenario: Check that groups option in search form appears when intended
|
||||
# Switch to mocked Solr search because simpledb doesn't support groups.
|
||||
Given the following config values are set as admin:
|
||||
Given solr is installed
|
||||
And the following config values are set as admin:
|
||||
| searchengine | solr |
|
||||
And the following "groups" exist:
|
||||
| name | course | idnumber |
|
||||
|
Loading…
x
Reference in New Issue
Block a user