| @@ 366-375 (lines=10) @@ | ||
| 363 | /** |
|
| 364 | * @ticket 22960 |
|
| 365 | */ |
|
| 366 | function test_get_attached_images() |
|
| 367 | { |
|
| 368 | $post_id = self::factory()->post->create(); |
|
| 369 | $attachment_id = self::factory()->attachment->create_object( |
|
| 370 | $this->img_name, $post_id, array( |
|
| 371 | 'post_mime_type' => 'image/jpeg', |
|
| 372 | 'post_type' => 'attachment' |
|
| 373 | ) |
|
| 374 | ); |
|
| 375 | ||
| 376 | $images = get_attached_media('image', $post_id); |
|
| 377 | $this->assertEquals($images, array( $attachment_id => get_post($attachment_id) )); |
|
| 378 | } |
|
| @@ 594-604 (lines=11) @@ | ||
| 591 | $this->assertEquals($other_att, get_page_by_path('some-other-page')); |
|
| 592 | } |
|
| 593 | ||
| 594 | function test_wp_publish_post() |
|
| 595 | { |
|
| 596 | $draft_id = self::factory()->post->create(array( 'post_status' => 'draft' )); |
|
| 597 | ||
| 598 | $post = get_post($draft_id); |
|
| 599 | $this->assertEquals('draft', $post->post_status); |
|
| 600 | ||
| 601 | wp_publish_post($draft_id); |
|
| 602 | $post = get_post($draft_id); |
|
| 603 | ||
| 604 | $this->assertEquals('publish', $post->post_status); |
|
| 605 | } |
|
| 606 | ||
| 607 | /** |
|