mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +00:00
Tests: Use the factory method instead of the property.
This replaces all references to the `WP_UnitTestCase_Base::$factory` property with static function calls to the `WP_UnitTestCase_Base::factory()` method. This is a consistency improvement for the test suite. Follow up to [35225], [35242], [49603], [54087], [54088]. Props jrf. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54090 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -55,7 +55,7 @@ class Tests_Date_GetFeedBuildDate extends WP_UnitTestCase {
|
||||
|
||||
$this->assertFalse( get_feed_build_date( DATE_RFC3339 ), 'False when unable to determine valid time' );
|
||||
|
||||
$this->factory->post->create(
|
||||
self::factory()->post->create(
|
||||
array(
|
||||
'post_date' => $datetime->format( 'Y-m-d H:i:s' ),
|
||||
)
|
||||
@@ -68,7 +68,7 @@ class Tests_Date_GetFeedBuildDate extends WP_UnitTestCase {
|
||||
'Fall back to time of last post modified with no posts'
|
||||
);
|
||||
|
||||
$post_id_broken = $this->factory->post->create();
|
||||
$post_id_broken = self::factory()->post->create();
|
||||
$post_broken = get_post( $post_id_broken );
|
||||
|
||||
$post_broken->post_modified_gmt = 0;
|
||||
|
||||
Reference in New Issue
Block a user