Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions tests/phpunit/tests/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ public function test_use_block_editor_for_post() {
*/
public function test_wp_insert_post_handle_malformed_post_date( $input, $expected ) {
$post = array(
'post_author' => self::$editor_id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this referencing a variable that doesn't exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe the variable was changed by this commit.

06ef70d#diff-8da4b7dbfcc892321314b557b811accffd33adc7e407ac65cda306930c817957

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. So it seems a stale patch was committed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

'post_author' => self::$user_ids['editor'],
'post_status' => 'publish',
'post_content' => 'content',
'post_title' => 'title',
Expand Down Expand Up @@ -893,37 +893,38 @@ public function data_wp_insert_post_handle_malformed_post_date() {
'2012-01-01 00:60:00',
true,
),
// Failures.
// Dates without leading zeros (valid but malformed format).
array(
'2012-08-0z',
false,
'2012-08-1',
true,
),
array(
'2012-08-1',
false,
'2012-1-08 00:00:00',
true,
),
array(
'201-01-08 00:00:00',
false,
'2012-01-8 00:00:00',
true,
),
// Failures.
array(
'201-01-08 00:60:00',
'2012-08-0z',
false,
),
array(
'201a-01-08 00:00:00',
'201-01-08 00:00:00',
false,
),
array(
'2012-1-08 00:00:00',
'201-01-08 00:60:00',
false,
),
array(
'2012-31-08 00:00:00',
'201a-01-08 00:00:00',
false,
),
array(
'2012-01-8 00:00:00',
'2012-31-08 00:00:00',
false,
),
array(
Expand Down Expand Up @@ -1016,24 +1017,25 @@ public function data_wp_resolve_post_date_regex() {
'2012-01-01 00:00:60',
'2012-01-01 00:00:60',
),
// Dates without leading zeros (valid but malformed format).
array(
'201-01-08',
false,
'2012-1-08',
'2012-1-08',
),
array(
'201a-01-08',
false,
'2012-01-8',
'2012-01-8',
),
array(
'2012-1-08',
'201-01-08',
false,
),
array(
'2012-31-08',
'201a-01-08',
false,
),
array(
'2012-01-8',
'2012-31-08',
false,
),
array(
Expand Down
Loading