Tests: Simplify some assertions in phpunit/tests/media.php
.
Correct comments per the documentation standards. Follow-up to [48496]. See #22101. git-svn-id: https://develop.svn.wordpress.org/trunk@48516 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e80b4f64bf
commit
fa7b1bbb99
@ -2947,14 +2947,14 @@ EOF;
|
|||||||
$this->assertTrue( wp_image_file_matches_image_meta( $image_src, $image_meta ) );
|
$this->assertTrue( wp_image_file_matches_image_meta( $image_src, $image_meta ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ticket 22101
|
* @ticket 22101
|
||||||
*/
|
*/
|
||||||
function test_gallery_shortcode_when_is_feed_true() {
|
function test_gallery_shortcode_when_is_feed_true() {
|
||||||
|
|
||||||
$this->go_to( '/?feed=rss2' );
|
$this->go_to( '/?feed=rss2' );
|
||||||
|
|
||||||
// Default: Links to image attachment page url
|
// Default: Links to image attachment page URL.
|
||||||
$actual = gallery_shortcode(
|
$actual = gallery_shortcode(
|
||||||
array(
|
array(
|
||||||
'ids' => self::$large_id,
|
'ids' => self::$large_id,
|
||||||
@ -2962,23 +2962,23 @@ EOF;
|
|||||||
);
|
);
|
||||||
$this->assertContains( '?attachment_id=', $actual );
|
$this->assertContains( '?attachment_id=', $actual );
|
||||||
|
|
||||||
// File: Links to image file url
|
// File: Links to image file URL.
|
||||||
$actual = gallery_shortcode(
|
$actual = gallery_shortcode(
|
||||||
array(
|
array(
|
||||||
'ids' => self::$large_id,
|
'ids' => self::$large_id,
|
||||||
'link' => 'file',
|
'link' => 'file',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->assertTrue( 2 === substr_count( $actual, '.jpg' ) );
|
$this->assertEquals( 2, substr_count( $actual, '.jpg' ) );
|
||||||
|
|
||||||
// None: Does not link
|
// None: Does not link.
|
||||||
$actual = gallery_shortcode(
|
$actual = gallery_shortcode(
|
||||||
array(
|
array(
|
||||||
'ids' => self::$large_id,
|
'ids' => self::$large_id,
|
||||||
'link' => 'none',
|
'link' => 'none',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->assertFalse( strpos( $actual, '<a ' ) );
|
$this->assertNotContains( '<a ', $actual );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user