mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-54656 behat: Skip test if db family is not mysql or postgres
This commit is contained in:
parent
d21942998c
commit
99ad3223a5
@ -1559,4 +1559,27 @@ class behat_general extends behat_base {
|
||||
$node = $this->get_selected_node($selectortype, $element);
|
||||
$this->getSession()->getDriver()->post_key("\xEE\x80\x84", $node->getXpath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if database family used is using one of the specified, else skip. (mysql, postgres, mssql, oracle, etc.)
|
||||
*
|
||||
* @Given /^database family used is one of the following:$/
|
||||
* @param TableNode $databasefamilies list of database.
|
||||
* @return void.
|
||||
* @throws \Moodle\BehatExtension\Exception\SkippedException
|
||||
*/
|
||||
public function database_family_used_is_one_of_the_following(TableNode $databasefamilies) {
|
||||
global $DB;
|
||||
|
||||
$dbfamily = $DB->get_dbfamily();
|
||||
|
||||
// Check if used db family is one of the specified ones. If yes then return.
|
||||
foreach ($databasefamilies->getRows() as $dbfamilytocheck) {
|
||||
if ($dbfamilytocheck[0] == $dbfamily) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw new \Moodle\BehatExtension\Exception\SkippedException();
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,10 @@ Feature: The forum search allows users to perform advanced searches for forum po
|
||||
And I should not see "My subjective"
|
||||
|
||||
Scenario: Perform an advanced search using whole words
|
||||
Given I log in as "student1"
|
||||
Given database family used is one of the following:
|
||||
| mysql |
|
||||
| postgres |
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Announcements"
|
||||
And I press "Search forums"
|
||||
|
Loading…
x
Reference in New Issue
Block a user