Ticket #35492: 35492.2.diff
File 35492.2.diff, 3.2 KB (added by , 9 years ago) |
---|
-
tests/phpunit/includes/factory/class-wp-unittest-factory.php
1 1 <?php 2 2 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 14 3 class WP_UnitTest_Factory { 15 4 16 5 /** -
tests/phpunit/includes/factory.php
10 10 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-term.php' ); 11 11 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-generator-sequence.php' ); 12 12 require_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 } 13 require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory.php' );