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

Handle CFG->phpunit_dataroot like CFG->dataroot is

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4, 2.4.1, 2.5
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: Unit tests
    • Labels:
      None
    • Testing Instructions:
      Hide

      0. Setup your site so you make $CFG->phpunit_dataroot to point to one link to a real directory (unix/mac required?)

      a. Running:

      phpunit moodlelib_testcase lib/tests/moodlelib_test.php

      should be enough as far as it includes 1 assertion checking for this.

      b. Running all tests will confirm nothing else breaks with the changes.

      1. Repeat a & b with $CFG->phpunit_dataroot pointing to a real directory.

      That is, ciao

      Show
      0. Setup your site so you make $CFG->phpunit_dataroot to point to one link to a real directory (unix/mac required?) a. Running: phpunit moodlelib_testcase lib/tests/moodlelib_test.php should be enough as far as it includes 1 assertion checking for this. b. Running all tests will confirm nothing else breaks with the changes. 1. Repeat a & b with $CFG->phpunit_dataroot pointing to a real directory. That is, ciao
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When running unittests it should be always true that:

      CFG->phpunit_dataroot === CFG->dataroot

      but this has been detected to fail sometimes (see MDL-34344 failing tests).

      The ultimate reason seems to be that we always realpath(CFG->dataroot) but don't do the same with CFG->phpunit_dataroot.

      So this is a proposal to, simply, apply the realpath() to CFG->phpunit_dataroot to ensure that the equality above always works.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Peer reviewer:
              Petr Skoda
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Mar/13