Make WordPress Core

Ticket #39304: 39304-tests.diff

File 39304-tests.diff, 797 bytes (added by joemcgill, 8 years ago)

Unit test only

  • tests/phpunit/tests/media.php

    diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
    index 5d1e52be85b..25a74ddba86 100644
    BLOB; 
    391391        }
    392392
    393393        /**
     394         * @ticket 39304
     395         */
     396        function test_post_galleries_images_without_global_post() {
     397                // Set up an unattached image.
     398                $this->factory->attachment->create_object( array(
     399                        'file' => 'test.jpg',
     400                        'post_parent' => 0,
     401                        'post_mime_type' => 'image/jpeg',
     402                        'post_type' => 'attachment'
     403                ) );
     404
     405                $post_id = $this->factory->post->create( array(
     406                        'post_content' => '[gallery]',
     407                ) );
     408
     409                $galleries = get_post_galleries( $post_id, false );
     410
     411                $this->assertEmpty( $galleries[0]['src'] );
     412        }
     413
     414        /**
    394415         * @ticket 22960
    395416         */
    396417        function test_post_gallery_images() {