Make WordPress Core


Ignore:
Timestamp:
01/27/2016 03:26:15 AM (9 years ago)
Author:
ericlewis
Message:

Build/Test Tools: Move class WP_UnitTest_Factory into its own file.

In [36347] we moved all PHP factory classes into their own files except the main class. The main class is now in its own file, and factory.php is solely an include manifest for all factory classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/factory.php

    r36347 r36409  
    1111require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-generator-sequence.php' );
    1212require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-callback-after-create.php' );
    13 
    14 class WP_UnitTest_Factory {
    15 
    16     /**
    17      * @var WP_UnitTest_Factory_For_Post
    18      */
    19     public $post;
    20 
    21     /**
    22      * @var WP_UnitTest_Factory_For_Attachment
    23      */
    24     public $attachment;
    25 
    26     /**
    27      * @var WP_UnitTest_Factory_For_Comment
    28      */
    29     public $comment;
    30 
    31     /**
    32      * @var WP_UnitTest_Factory_For_User
    33      */
    34     public $user;
    35 
    36     /**
    37      * @var WP_UnitTest_Factory_For_Term
    38      */
    39     public $term;
    40 
    41     /**
    42      * @var WP_UnitTest_Factory_For_Term
    43      */
    44     public $category;
    45 
    46     /**
    47      * @var WP_UnitTest_Factory_For_Term
    48      */
    49     public $tag;
    50 
    51     /**
    52      * @var WP_UnitTest_Factory_For_Blog
    53      */
    54     public $blog;
    55 
    56     /**
    57      * @var WP_UnitTest_Factory_For_Network
    58      */
    59     public $network;
    60 
    61     function __construct() {
    62         $this->post = new WP_UnitTest_Factory_For_Post( $this );
    63         $this->attachment = new WP_UnitTest_Factory_For_Attachment( $this );
    64         $this->comment = new WP_UnitTest_Factory_For_Comment( $this );
    65         $this->user = new WP_UnitTest_Factory_For_User( $this );
    66         $this->term = new WP_UnitTest_Factory_For_Term( $this );
    67         $this->category = new WP_UnitTest_Factory_For_Term( $this, 'category' );
    68         $this->tag = new WP_UnitTest_Factory_For_Term( $this, 'post_tag' );
    69         if ( is_multisite() ) {
    70             $this->blog = new WP_UnitTest_Factory_For_Blog( $this );
    71             $this->network = new WP_UnitTest_Factory_For_Network( $this );
    72         }
    73     }
    74 }
     13require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory.php' );
Note: See TracChangeset for help on using the changeset viewer.