Make WordPress Core


Ignore:
Timestamp:
06/20/2014 06:26:17 PM (10 years ago)
Author:
wonderboymusic
Message:

Reinstate the changes from [28579] with some adjustments:

  • Check ! empty( $postarr['file'] ) before calling update_attached_file()
  • Add a unit test: test_update_attachment_fields()
  • Run the same logic for empty guid for attachments that always ran in wp_insert_post(), as per #18310. This fixes a unit test that would have broken when this ticket was marked closed.
  • Updated the unit test in Tests_Media::test_wp_prepare_attachment_for_js() to account for url no longer being empty

Props kovshenin, wonderboymusic.
See #21963.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/media.php

    r27726 r28788  
    149149        $this->assertEquals( '', $prepped['type'] );
    150150        $this->assertEquals( '', $prepped['subtype'] );
    151         $this->assertEquals( '', $prepped['url'] );
     151        // #21963, there will be a guid always, so there will be a URL
     152        $this->assertNotEquals( '', $prepped['url'] );
    152153        $this->assertEquals( site_url( 'wp-includes/images/media/default.png' ), $prepped['icon'] );
    153154
Note: See TracChangeset for help on using the changeset viewer.