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

phpunit testcase autoloader

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Unit tests
    • Labels:
      None
    • Testing Instructions:
      Hide

      1/ Execute individual phpunit tests in linux/mac

      You may need to build new configs first:

      php admin/tool/phpunit/cli/util.php --buildcomponentconfigs
      php admin/tool/phpunit/cli/util.php --buildconfig
      

      Some test with proper frankenstyle which supports autoloading (must work):

      vendor/bin/phpunit core_component_testcase
      vendor/bin/phpunit core_component_testcase lib/tests/component_test.php
      vendor/bin/phpunit lib/tests/component_test.php
      

      Some incorrectly named testcase (must work):

      vendor/bin/phpunit collatorlib_testcase lib/tests/textlib_test.php
      

      Some "broken" test file with multiple testacses (must fail):

      vendor/bin/phpunit lib/tests/textlib_test.php
      

      2/ repeat in windows, please note both / and \ should be now supported in relative paths

      vendor\bin\phpunit.bat core_component_testcase
      vendor\bin\phpunit.bat core_component_testcase lib\tests\component_test.php
      vendor\bin\phpunit.bat core_component_testcase lib/tests/component_test.php
      vendor\bin\phpunit.bat lib/tests/component_test.php
      vendor\bin\phpunit.bat lib\tests\component_test.php
      

      Show
      1/ Execute individual phpunit tests in linux/mac You may need to build new configs first: php admin/tool/phpunit/cli/util.php --buildcomponentconfigs php admin/tool/phpunit/cli/util.php --buildconfig Some test with proper frankenstyle which supports autoloading (must work): vendor/bin/phpunit core_component_testcase vendor/bin/phpunit core_component_testcase lib/tests/component_test.php vendor/bin/phpunit lib/tests/component_test.php Some incorrectly named testcase (must work): vendor/bin/phpunit collatorlib_testcase lib/tests/textlib_test.php Some "broken" test file with multiple testacses (must fail): vendor/bin/phpunit lib/tests/textlib_test.php 2/ repeat in windows, please note both / and \ should be now supported in relative paths vendor\bin\phpunit.bat core_component_testcase vendor\bin\phpunit.bat core_component_testcase lib\tests\component_test.php vendor\bin\phpunit.bat core_component_testcase lib/tests/component_test.php vendor\bin\phpunit.bat lib/tests/component_test.php vendor\bin\phpunit.bat lib\tests\component_test.php
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w26_MDL-40305_m26_phpunitloader

      Description

      phpunit should be able to find the file where is the testcase defined automatically...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              skodak Petr Skoda
              Integrator:
              Sam Hemelryk
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13