Skip to content

Commit f146384

Browse files
committed
Remove tests which do not cover issue
1 parent 3feaf8b commit f146384

File tree

1 file changed

+0
-112
lines changed

1 file changed

+0
-112
lines changed

tests/phpunit/tests/admin/exportWp.php

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -474,116 +474,4 @@ public function test_export_with_null_term_meta_values() {
474474
$this->assertNotFalse( $xml, 'Export should not fail with NULL term meta values' );
475475
$this->assertGreaterThan( 0, count( $xml->channel->item ), 'Export should contain items' );
476476
}
477-
478-
/**
479-
* Tests that export handles posts with NULL title and content without fatal errors.
480-
*
481-
* @ticket 64347
482-
*/
483-
public function test_export_with_null_post_fields() {
484-
global $wpdb;
485-
486-
// Create a post first.
487-
$post_id = self::factory()->post->create(
488-
array(
489-
'post_title' => 'Test Post',
490-
'post_content' => 'Test content',
491-
'post_type' => 'post',
492-
)
493-
);
494-
495-
// Update to set NULL values directly (bypassing WordPress API).
496-
$wpdb->update(
497-
$wpdb->posts,
498-
array(
499-
'post_excerpt' => null,
500-
),
501-
array( 'ID' => $post_id ),
502-
array( '%s' ),
503-
array( '%d' )
504-
);
505-
506-
$xml = $this->get_the_export(
507-
array(
508-
'content' => 'post',
509-
)
510-
);
511-
512-
$this->assertNotFalse( $xml, 'Export should not fail with NULL post fields' );
513-
$this->assertGreaterThan( 0, count( $xml->channel->item ), 'Export should contain items' );
514-
515-
// Verify the post is in the export.
516-
$found_post = false;
517-
foreach ( $xml->channel->item as $item ) {
518-
$wp_item = $item->children( 'wp', true );
519-
if ( (int) $wp_item->post_id === $post_id ) {
520-
$found_post = true;
521-
break;
522-
}
523-
}
524-
525-
$this->assertTrue( $found_post, 'Post with NULL excerpt should be included in export' );
526-
}
527-
528-
/**
529-
* Tests that export handles user fields with potential NULL values.
530-
*
531-
* @ticket 64347
532-
*/
533-
public function test_export_with_users_having_empty_fields() {
534-
global $wpdb;
535-
536-
$user_id = self::factory()->user->create(
537-
array(
538-
'user_login' => 'testuser_export',
539-
'user_email' => '[email protected]',
540-
'first_name' => '',
541-
'last_name' => '',
542-
'display_name' => 'Test User',
543-
)
544-
);
545-
546-
$post_id = self::factory()->post->create(
547-
array(
548-
'post_title' => 'Post by User with Empty Fields',
549-
'post_author' => $user_id,
550-
'post_type' => 'post',
551-
)
552-
);
553-
554-
$wpdb->update(
555-
$wpdb->users,
556-
array(
557-
'display_name' => null,
558-
),
559-
array(
560-
'ID' => $user_id,
561-
),
562-
array( '%s' ),
563-
array( '%d' )
564-
);
565-
566-
clean_user_cache( $user_id );
567-
568-
$xml = $this->get_the_export(
569-
array(
570-
'content' => 'post',
571-
)
572-
);
573-
574-
$this->assertNotFalse( $xml, 'Export should not fail with users having empty name fields' );
575-
576-
// Check that the author is in the export.
577-
$authors = $xml->channel->children( 'wp', true );
578-
$found_author = false;
579-
580-
foreach ( $authors as $author ) {
581-
if ( isset( $author->author_id ) && (int) $author->author_id === $user_id ) {
582-
$found_author = true;
583-
break;
584-
}
585-
}
586-
587-
$this->assertTrue( $found_author, 'User with empty name fields should be included in export' );
588-
}
589477
}

0 commit comments

Comments
 (0)