Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-85565

get_contains_select_expectation() does not check if <select> really exists

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.18, 4.4.8, 4.5.4, 5.0
    • Questions

      When using something like

      $this->check_output_contains_selectoptions(
      $this->get_contains_select_expectation('0_0', ['foo', 'bar'])
      );

      in a walkthrough test, one would expect the test to fail if the output does not contain a <select> element. However, the test will pass, although with no assertions being made.

      This is due to the fact that the test fetches all <select> elements on the page and, for each one of them, checks whether it contains the given options. If there is no <select> , no checks will be done and hence, nothing can fail.

            philippimhof Philipp Imhof
            philippimhof Philipp Imhof
            Daniel Ziegenberg Daniel Ziegenberg
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.