Make WordPress Core

Ticket #35492: 35492.2.diff

File 35492.2.diff, 3.2 KB (added by ericlewis, 9 years ago)
  • tests/phpunit/includes/factory/class-wp-unittest-factory.php

     
    11<?php
    22
    3 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-thing.php' );
    4 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-post.php' );
    5 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-attachment.php' );
    6 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-user.php' );
    7 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-comment.php' );
    8 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-blog.php' );
    9 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-network.php' );
    10 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-term.php' );
    11 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-generator-sequence.php' );
    12 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-callback-after-create.php' );
    13 
    143class WP_UnitTest_Factory {
    154
    165        /**
  • tests/phpunit/includes/factory.php

     
    1010require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-term.php' );
    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' );