Commit 738a2747 authored by Robert Lyon's avatar Robert Lyon
Browse files

Fixes for broken behat tests



behatnotneeded

Change-Id: I71fc705d8d02bb0273aa51cdba31e64abc860fab
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d707c7de
......@@ -182,15 +182,16 @@ if ($institution || $add) {
delete_records('institution_config', 'institution', $values['i']);
delete_records('usr_custom_layout', 'institution', $values['i']);
delete_records('usr_registration', 'institution', $values['i']);
$versions = get_records_assoc('site_content_version', 'institution', $values['i']);
foreach($versions as $version) {
delete_records('usr_agreement', 'sitecontentid', $version->id);
if ($versions = get_records_assoc('site_content_version', 'institution', $values['i'])) {
foreach($versions as $version) {
delete_records('usr_agreement', 'sitecontentid', $version->id);
}
}
delete_records('site_content_version', 'institution', $values['i']);
delete_records('oauth_server_registry', 'institution', $values['i']);
delete_records('institution', 'name', $values['i']);
db_commit();
clear_menu_cache();
$SESSION->add_ok_msg(get_string('institutiondeletedsuccessfully', 'admin'));
redirect('/admin/users/institutions.php');
}
......
......@@ -913,9 +913,9 @@ EOF;
}
else {
$step_funct = $this->switch_funct($step_funct);
$step_funct = $this->switch_action($step_funct);
// switch covers steps in BehatGeneral that pass a css_locator
$this->$funct($text, $css_locator[0], $css_locator[1]);
$this->$step_funct($text, $css_locator[0], $css_locator[1]);
}
}
......
......@@ -38,7 +38,7 @@ Scenario: Creating institution tags
And I follow "Create tag"
And I set the field "Institution tag" to "Two tag"
And I press "Save"
And I follow "Delete institution tag" in "Two tag" row
And I click on "Delete institution tag" in "Two tag" row
Then I should see "Institution tag deleted successfully"
And I log out
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment