mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes.
This brings consistency to this often-used method, and allows IDEs to provide help to developers when using its `$factory` parameter. See #51344 git-svn-id: https://develop.svn.wordpress.org/trunk@49603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,7 +15,7 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||
*/
|
||||
public $structure = '/%year%/%monthnum%/%day%/%postname%/';
|
||||
|
||||
public static function wpSetUpBeforeClass( $factory ) {
|
||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||
self::generate_shared_fixtures( $factory );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||
*
|
||||
* @since 4.1.0
|
||||
*/
|
||||
public static function generate_shared_fixtures( $factory ) {
|
||||
public static function generate_shared_fixtures( WP_UnitTest_Factory $factory ) {
|
||||
self::$old_current_user = get_current_user_id();
|
||||
self::$author_id = $factory->user->create( array( 'user_login' => 'canonical-author' ) );
|
||||
|
||||
@@ -52,7 +52,7 @@ class WP_Canonical_UnitTestCase extends WP_UnitTestCase {
|
||||
wp_set_current_user( self::$author_id );
|
||||
|
||||
// Already created by install defaults:
|
||||
// self::factory()->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
|
||||
// $factory->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
|
||||
|
||||
self::$post_ids[] = $factory->post->create(
|
||||
array(
|
||||
|
||||
Reference in New Issue
Block a user