Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #53010


Ignore:
Timestamp:
04/09/2021 03:59:17 PM (3 years ago)
Author:
jrf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #53010 – Description

    v1 v2  
    2020
    2121To solve that, I would like to propose the following pattern:
    22 * File paths: `tests/phpunit/tests/wp-[includes|admin]/Class_Under_Test/FunctionUnderTest[OptionalSubsetIndicator]Test.php`
    23 * Namespace: `WordPress\Tests\WP_[Includes|Admin]\Class_Under_Test`
     22* File paths: `tests/phpunit/tests/wp-[includes|admin]/[SubFolder/]*Class_Under_Test/FunctionUnderTest[OptionalSubsetIndicator]Test.php`
     23* Namespace: `WordPress\Tests\WP_[Includes|Admin]\[SubFolder\]*Class_Under_Test`
    2424* Classname: `FunctionUnderTest[OptionalSubsetIndicator]Test`
     25
     26For WP Core files which only contain functions outside of a class structure, the following pattern is proposed:
     27* File paths: `tests/phpunit/tests/wp-[includes|admin]/[SubFolder/]*Functions_FileName/FunctionUnderTest[OptionalSubsetIndicator]Test.php`
     28* Namespace: `WordPress\Tests\WP_[Includes|Admin]\[SubFolder\]*Functions_FileName`
     29* Classname: `FunctionUnderTest[OptionalSubsetIndicator]Test`
     30
    2531
    2632The pattern I'm proposing does imply a re-organisation of the test suite directory and file structure, but that IMO is for the better.
     
    2935
    3036This will also allow for using PSR-4 autoloading for the tests classes and adding the `autoload-dev` directive to the `composer.json` file.
     37
     38
    3139
    3240== Planning