Make WordPress Core

Changeset 60674


Ignore:
Timestamp:
08/26/2025 09:52:58 PM (3 months ago)
Author:
jorbin
Message:

Build/Test Tools: Update in-repo PHPUnit documentation to point to a single source of truth.

Props q0rban, ironprogrammer, desrosj, peterwilsoncc, juampick.
Fixes #62065.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/README.md

    r60673 r60674  
    1 The short version:
     1# PHPUnit Tests
    22
    3 1. Create a clean MySQL database and user. DO NOT USE AN EXISTING DATABASE or you will lose data, guaranteed.
     3PHPUnit is the official testing framework chosen by the core team to test PHP code.
    44
    5 2. Copy wp-tests-config-sample.php to wp-tests-config.php, edit it and include your database name/user/password.
    6 
    7 3. $ svn up
    8 
    9 4. Run the tests from the "trunk" directory:
    10    To execute a particular test:
    11       $ phpunit tests/phpunit/tests/test_case.php
    12    To execute all tests:
    13       $ phpunit
    14 
    15 Notes:
    16 
    17 Test cases live in the 'tests' subdirectory. All files in that directory will be included by default. Extend the WP_UnitTestCase class to ensure your test is run.
    18 
    19 phpunit will initialize and install a (more or less) complete running copy of WordPress each time it is run. This makes it possible to run functional interface and module tests against a fully working database and codebase, as opposed to pure unit tests with mock objects and stubs. Pure unit tests may be used also, of course.
    20 
    21 Changes to the test database will be rolled back as tests are finished, to ensure a clean start next time the tests are run.
    22 
    23 phpunit is intended to run at the command line, not via a web server.
     5For more information, please review the relevant Core Handbook pages:
     6- [PHP: PHPUnit](https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/)
     7- [Writing PHP Tests](https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/)
Note: See TracChangeset for help on using the changeset viewer.