2013-08-07 08:38:38 +02:00
|
|
|
<?php
|
|
|
|
|
2016-01-19 04:55:19 +01:00
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-thing.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-post.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-attachment.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-user.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-comment.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-blog.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-network.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-term.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-generator-sequence.php' );
|
|
|
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-callback-after-create.php' );
|
|
|
|
|
2013-08-07 08:38:38 +02:00
|
|
|
class WP_UnitTest_Factory {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Post
|
|
|
|
*/
|
|
|
|
public $post;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Attachment
|
|
|
|
*/
|
|
|
|
public $attachment;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Comment
|
|
|
|
*/
|
|
|
|
public $comment;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_User
|
|
|
|
*/
|
|
|
|
public $user;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Term
|
|
|
|
*/
|
|
|
|
public $term;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Term
|
|
|
|
*/
|
|
|
|
public $category;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Term
|
|
|
|
*/
|
|
|
|
public $tag;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Blog
|
|
|
|
*/
|
|
|
|
public $blog;
|
|
|
|
|
2014-02-14 00:06:12 +01:00
|
|
|
/**
|
|
|
|
* @var WP_UnitTest_Factory_For_Network
|
|
|
|
*/
|
|
|
|
public $network;
|
|
|
|
|
2013-08-07 08:38:38 +02:00
|
|
|
function __construct() {
|
|
|
|
$this->post = new WP_UnitTest_Factory_For_Post( $this );
|
|
|
|
$this->attachment = new WP_UnitTest_Factory_For_Attachment( $this );
|
|
|
|
$this->comment = new WP_UnitTest_Factory_For_Comment( $this );
|
|
|
|
$this->user = new WP_UnitTest_Factory_For_User( $this );
|
|
|
|
$this->term = new WP_UnitTest_Factory_For_Term( $this );
|
|
|
|
$this->category = new WP_UnitTest_Factory_For_Term( $this, 'category' );
|
|
|
|
$this->tag = new WP_UnitTest_Factory_For_Term( $this, 'post_tag' );
|
2014-02-14 00:06:12 +01:00
|
|
|
if ( is_multisite() ) {
|
2013-08-07 08:38:38 +02:00
|
|
|
$this->blog = new WP_UnitTest_Factory_For_Blog( $this );
|
2014-02-14 00:06:12 +01:00
|
|
|
$this->network = new WP_UnitTest_Factory_For_Network( $this );
|
|
|
|
}
|
2013-08-07 08:38:38 +02:00
|
|
|
}
|
|
|
|
}
|