attachment_url_to_postid() should always return an integer.

props nathan_dawson, ashfame.
fixes #31044.

git-svn-id: https://develop.svn.wordpress.org/trunk@31239 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2015-01-18 20:32:50 +00:00
parent a79297ba2d
commit a036114a4d
2 changed files with 12 additions and 4 deletions
+9
View File
@@ -501,6 +501,15 @@ VIDEO;
return $dir;
}
/**
* @ticket 31044
*/
function test_attachment_url_to_postid_with_empty_url() {
$post_id = attachment_url_to_postid( '' );
$this->assertInternalType( 'int', $post_id );
$this->assertEquals( 0, $post_id );
}
function test_wp_check_filetype() {
$url = 'http://example.com/testFile.mp4?autoplay=true&otherstuff=false';
$filetype = wp_check_filetype( $url );