mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +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:
@@ -24,7 +24,7 @@ class Tests_Admin_IncludesComment extends WP_UnitTestCase {
|
||||
*
|
||||
* @param WP_UnitTest_Factory $factory
|
||||
*/
|
||||
public static function wpSetUpBeforeClass( $factory ) {
|
||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||
self::$post_id = $factory->post->create();
|
||||
|
||||
self::$comment_ids[] = $factory->comment->create(
|
||||
|
||||
@@ -19,7 +19,7 @@ class Tests_Admin_includesListTable extends WP_UnitTestCase {
|
||||
$this->table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => 'edit-page' ) );
|
||||
}
|
||||
|
||||
public static function wpSetUpBeforeClass( $factory ) {
|
||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||
// Note that our top/children/grandchildren arrays are 1-indexed.
|
||||
|
||||
// Create top-level pages.
|
||||
|
||||
@@ -12,7 +12,7 @@ class Tests_Admin_Includes_Post extends WP_UnitTestCase {
|
||||
|
||||
protected static $user_ids = array();
|
||||
|
||||
public static function wpSetUpBeforeClass( $factory ) {
|
||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||
self::$user_ids = $factory->user->create_many( 2, array( 'role' => 'author' ) );
|
||||
self::$author_ids = self::$user_ids;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class Tests_Admin_Includes_Schema extends WP_UnitTestCase {
|
||||
/**
|
||||
* Make sure the schema code is loaded before the tests are run.
|
||||
*/
|
||||
public static function wpSetUpBeforeClass() {
|
||||
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
|
||||
global $wpdb;
|
||||
|
||||
self::$options = 'testprefix_options';
|
||||
|
||||
Reference in New Issue
Block a user