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

phpunit testcase autoloader

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Unit tests
    • None
    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • w26_MDL-40305_m26_phpunitloader
    • 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

    Description

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

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Sam Hemelryk Sam Hemelryk
              Sam Hemelryk Sam Hemelryk
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13