Skip to content

Commit 1896812

Browse files
committed
CS Fixes.
1 parent 9df3b07 commit 1896812

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/class-test-indexnow-pings.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function assertNotPing( $expected_url, $message = '' ) {
130130
* Ensure a new post triggers a ping to IndexNow.
131131
*/
132132
public function test_ping_on_post_publish() {
133-
$post_id = $this->factory->post->create(
133+
$this->factory->post->create(
134134
array(
135135
'post_status' => 'publish',
136136
'post_title' => 'Test Post',
@@ -162,11 +162,22 @@ public function test_ping_on_post_update() {
162162
* Ensure trashing a previously published post pings the old URL.
163163
*/
164164
public function test_ping_on_post_trash() {
165-
$post_id = self::$post_ids['publish'];
165+
$post_id = self::$post_ids['publish'];
166166

167167
wp_trash_post( $post_id );
168168

169169
$this->assertPing( home_url( '/2025/test-post-publish/' ), 'Ping should include the post URL on trash.' );
170170
$this->assertNotPing( home_url( "/?p={$post_id}" ), 'Ping should not include the trashed post URL.' );
171171
}
172+
173+
/**
174+
* Ensure publishing a draft post pings the URL.
175+
*/
176+
public function test_ping_on_draft_publish() {
177+
$post_id = self::$post_ids['draft'];
178+
179+
wp_publish_post( $post_id );
180+
181+
$this->assertPing( home_url( '/2025/test-post-draft/' ), 'Ping should include the post URL on draft publish.' );
182+
}
172183
}

0 commit comments

Comments
 (0)