Moodle
  1. Moodle
  2. MDL-20391

lib/simpletest/testfilelib.php causing fatal errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: STABLE backlog
    • Component/s: Files API
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      2479

      Description

      lib/simpletest/testfilelib.php does require_once($CFG->dirroot.'/user/lib.php'); which does not exist, causing fatal errors.

      CVS says you introduced it Nico. Please fix.

      I have committed a temporary change commenting out that line.

      (Also many blog unit test failures for me.)

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Actually commenting that out was insufficient, since one of the tests uses a non-existant create_user function.

          New interim fix: lib/simpletest/testfilelib.php renamed to lib/simpletest/broken_testfilelib.php

          Show
          Tim Hunt added a comment - Actually commenting that out was insufficient, since one of the tests uses a non-existant create_user function. New interim fix: lib/simpletest/testfilelib.php renamed to lib/simpletest/broken_testfilelib.php
          Hide
          Gabriel Dias added a comment -

          Hi there, i submitted a patch where i replace the create_user function call for $this->user->id = $DB->insert_record('user', $this->user);
          Then the tests run fine but there is some issue with test test_encodepath when comparing
          http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2%26forcedownload%3D1
          with
          file_encode_url('http://test.url.com', '/path/to/page.php?var1=value1&var2=value2', true)

          The file_encode_url function returns "http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2?forcedownload=1". As you can see the last "?" is wrong. I think there is no check over the quantity of parameters passed with the url when calling this function, if you agree i can create a bug and submit a patch too.

          Show
          Gabriel Dias added a comment - Hi there, i submitted a patch where i replace the create_user function call for $this->user->id = $DB->insert_record('user', $this->user); Then the tests run fine but there is some issue with test test_encodepath when comparing http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2%26forcedownload%3D1 with file_encode_url('http://test.url.com', '/path/to/page.php?var1=value1&var2=value2', true) The file_encode_url function returns "http://test.url.com/path/to/page.php%3Fvar1%3Dvalue1%26var2%3Dvalue2?forcedownload=1". As you can see the last "?" is wrong. I think there is no check over the quantity of parameters passed with the url when calling this function, if you agree i can create a bug and submit a patch too.
          Hide
          Martin Dougiamas added a comment -

          Is this still a problem?

          Show
          Martin Dougiamas added a comment - Is this still a problem?
          Hide
          Petr Škoda added a comment -

          unfortunately the 'broken' file tests need a complete rewrite, lowering priority for now

          Show
          Petr Škoda added a comment - unfortunately the 'broken' file tests need a complete rewrite, lowering priority for now
          Hide
          Dan Poltawski added a comment -

          I think this existed right until we switched to phpunit, closing wont fix.

          Show
          Dan Poltawski added a comment - I think this existed right until we switched to phpunit, closing wont fix.

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: