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

phpunit testcase autoloader

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.5
    • 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

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

            skodak Petr Skoda
            skodak Petr Skoda
            Sam Hemelryk Sam Hemelryk
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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