Make WordPress Core

Changeset 36854


Ignore:
Timestamp:
03/05/2016 07:47:41 PM (9 years ago)
Author:
ericlewis
Message:

Build/Test Tools: Document PHP unit test classes.

Props boonebgorges.
Fixes #35494.

Location:
trunk/tests/phpunit/includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory-for-thing.php

    r36347 r36854  
    11<?php
    22
     3/**
     4 * An abstract class that serves as a basis for all WordPress object-type factory classes.
     5 */
    36abstract class WP_UnitTest_Factory_For_Thing {
    47
  • trunk/tests/phpunit/includes/factory/class-wp-unittest-factory.php

    r36409 r36854  
    11<?php
    22
     3/**
     4 * A factory for making WordPress data with a cross-object type API.
     5 *
     6 * Tests should use this factory to generate test fixtures.
     7 */
    38class WP_UnitTest_Factory {
    49
  • trunk/tests/phpunit/includes/testcase.php

    r36721 r36854  
    44require_once dirname( __FILE__ ) . '/trac.php';
    55
     6/**
     7 * Defines a basic fixture to run multiple tests.
     8 *
     9 * Resets the state of the WordPress installation before and after every test.
     10 *
     11 * Includes utility functions and assertions useful for testing WordPress.
     12 *
     13 * All WordPress unit tests should inherit from this class.
     14 */
    615class WP_UnitTestCase extends PHPUnit_Framework_TestCase {
    716
     
    125134    }
    126135
     136    /**
     137     * After a test method runs, reset any state in WordPress the test method might have changed.
     138     */
    127139    function tearDown() {
    128140        global $wpdb, $wp_query, $wp, $post;
Note: See TracChangeset for help on using the changeset viewer.