Commit 1f712541 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1787493: Checking select option key with cast



behatnotneeded

Change-Id: Ib635d325c757e54d4a7a2403eebecffad08694b0
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent bc026f1d
......@@ -177,12 +177,11 @@ function pieform_element_select(Pieform $form, $element) {
function pieform_element_select_render_options($options, $values, &$optionselected, $element) {
$result = '';
foreach ($options as $key => $value) {
// Select the element if it's in the values or if there are no values
// and this is the first option
$stringvalue = !is_array($values) && (string)$key === (string)$values;
$stringvalue = !is_array($values) && $key == $values;
$inarrayvalue = is_array($values) && in_array($key, $values);
$firstoption = isset($values[0]) && $values[0] === null && !$optionselected;
......
......@@ -20,6 +20,7 @@ Scenario: Admin user can add an image to the "Logged -out home" static page and
And I expand the section "Image"
And I press "Select \"Image2.png\""
And I press "Submit"
And I wait "1" seconds
And I press "Save changes"
And I choose "Dashboard" from main menu
# check that the image uploaded is the image being seen on the page
......@@ -36,6 +37,7 @@ Scenario: Admin user can add an image to the "Home (Dashboard)" static page and
And I expand the section "Image"
And I press "Select \"Image2.png\""
And I press "Submit"
And I wait "1" seconds
And I press "Save changes"
And I log out
And I am on homepage
......
......@@ -74,6 +74,7 @@ Scenario: SmartEvidence interaction by member / staff
# Log in as admin/staff to assess the collection pages and make comments
Given I log in as "UserB" with password "Kupuh1pa!"
And I wait "1" seconds
And I follow "Smart Evidence Collection 1"
# Admin/staff selects the competencies ready for assessment and makes an annotation
# And sets the standard status
......
......@@ -98,5 +98,6 @@ Scenario: Comments update the page's mtime
And I press "Comment"
And I choose "Dashboard" from main menu
And I scroll to the id "column-container"
And I wait "1" seconds
Then I should see "Page UserA_02" in the ".bt-newviews" element
And I should not see "Page UserA_01" in the ".bt-newviews" element
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