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. git-svn-id: https://develop.svn.wordpress.org/trunk@36409 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
74f26214e7
commit
8d562e0d04
|
@ -10,65 +10,4 @@ require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-netw
|
||||||
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-for-term.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-generator-sequence.php' );
|
||||||
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-callback-after-create.php' );
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory-callback-after-create.php' );
|
||||||
|
require_once( dirname( __FILE__ ) . '/factory/class-wp-unittest-factory.php' );
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var WP_UnitTest_Factory_For_Network
|
|
||||||
*/
|
|
||||||
public $network;
|
|
||||||
|
|
||||||
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' );
|
|
||||||
if ( is_multisite() ) {
|
|
||||||
$this->blog = new WP_UnitTest_Factory_For_Blog( $this );
|
|
||||||
$this->network = new WP_UnitTest_Factory_For_Network( $this );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var WP_UnitTest_Factory_For_Network
|
||||||
|
*/
|
||||||
|
public $network;
|
||||||
|
|
||||||
|
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' );
|
||||||
|
if ( is_multisite() ) {
|
||||||
|
$this->blog = new WP_UnitTest_Factory_For_Blog( $this );
|
||||||
|
$this->network = new WP_UnitTest_Factory_For_Network( $this );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue