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

Exception incorrect when navigation node not found

    Details

    • Testing Instructions:
      Hide
      1. Edit the file admin/tool/behat/tests/behat/list_steps.feature to change 'Acceptance testing' to 'Acceptance testin'
      2. Run behat against admin/tool/behat/tests/behat/list_steps.feature
      3. VERIFY: you get the error 'Navigation node "Acceptance testin" not found under "Site administration > Development"' and NOT an array to string conversion
      Show
      Edit the file admin/tool/behat/tests/behat/list_steps.feature to change 'Acceptance testing' to 'Acceptance testin' Run behat against admin/tool/behat/tests/behat/list_steps.feature VERIFY: you get the error 'Navigation node "Acceptance testin" not found under "Site administration > Development"' and NOT an array to string conversion
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-47470-master

      Description

      The exception when a navigation node is not found is not right:

      01. Notice: Array to string conversion in /Users/danp/moodles/im/moodle/lib/tests/behat/behat_navigation.php line 270
          In step `And I navigate to "Acceptance testin" node in "Site administration > Development"'. # behat_navigation::i_navigate_to_node_in()
          From scenario background.                                                                    # /Users/danp/moodles/im/moodle/admin/tool/behat/tests/behat/list_steps.feature:7
          Of feature `List the system steps definitions'.                                              # /Users/danp/moodles/im/moodle/admin/tool/behat/tests/behat/list_steps.feature
      

      Steps to reproduce:

      1. Apply this patch:

      diff --git a/admin/tool/behat/tests/behat/list_steps.feature b/admin/tool/behat/tests/behat/list_steps.feature
      index 3e4d31e..c347819 100644
      --- a/admin/tool/behat/tests/behat/list_steps.feature
      +++ b/admin/tool/behat/tests/behat/list_steps.feature
      @@ -7,7 +7,7 @@ Feature: List the system steps definitions
         Background:
           Given I am on homepage
           And I log in as "admin"
      -    And I navigate to "Acceptance testing" node in "Site administration > Development"
      +    And I navigate to "Acceptance testin" node in "Site administration > Development"
      
         @javascript
         Scenario: Accessing the list
      

      2. Run behat on admin/tool/behat/tests/behat/list_steps.feature

      Expected result:
      Correct exception

      Actual result:
      Array to string conversion

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14