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

The "I wait to be redirected" Behat step has an invalid HTTP method "get"

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-78703-401
    • Hide
      1. Make the following change:

        $ git diff
        diff --git a/admin/contentbank.php b/admin/contentbank.php
        index 98514e2204a..ca4aafc5f2f 100644
        --- a/admin/contentbank.php
        +++ b/admin/contentbank.php
        @@ -84,4 +84,4 @@ $cache->purge();
         $cache = cache::make('core', 'contentbank_context_extensions');
         $cache->purge();
         
        -redirect($return);
        +echo $OUTPUT->redirect_message("{$CFG->wwwroot}/admin/settings.php?section=managecontentbanktypes", '', 2, false);
        

      2. Upload MDL-78703.feature to contentbank/tests/behat/MDL-78703.feature
      3. Initialise Behat
      4. Confirm the scenario passes, e.g.:

        $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Test MDL-78703"
        

      Show
      Make the following change: $ git diff diff --git a/admin/contentbank.php b/admin/contentbank.php index 98514e2204a..ca4aafc5f2f 100644 --- a/admin/contentbank.php +++ b/admin/contentbank.php @@ -84,4 +84,4 @@ $cache->purge(); $cache = cache::make('core', 'contentbank_context_extensions'); $cache->purge(); -redirect($return); +echo $OUTPUT->redirect_message("{$CFG->wwwroot}/admin/settings.php?section=managecontentbanktypes", '', 2, false); Upload MDL-78703.feature to contentbank/tests/behat/ MDL-78703 .feature Initialise Behat Confirm the scenario passes, e.g.: $ bin/moodle-docker-compose exec --user www-data webserver php admin/tool/behat/cli/run.php --name="Test MDL-78703"

      Hi!.

      In the following path lib/tests/behat/behat_general.php, the i_wait_to_be_redirected() function has the following line:

      $this->getSession()>getDriver()>getClient()->request('get', $url);

      The HTTP method "get" needs to be in uppercase letters. If a Behat test executes that line, the following error is displayed:

      Invalid HTTP method "get", only uppercase letters are accepted. (Symfony\Component\HttpClient\Exception\InvalidArgumentException)

       

      Thanks!

            pholden Paul Holden
            daniel.cifuentes Daniel Cifuentes
            Simey Lameze Simey Lameze
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 21 minutes
                2h 21m

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