|
@@ 1750-1757 (lines=8) @@
|
| 1747 |
|
* @ticket 34898 |
| 1748 |
|
* @ticket 33641 |
| 1749 |
|
*/ |
| 1750 |
|
function test_wp_make_content_images_responsive_wrong() |
| 1751 |
|
{ |
| 1752 |
|
$image = get_image_tag(self::$large_id, '', '', '', 'medium'); |
| 1753 |
|
|
| 1754 |
|
// Replace the src URL |
| 1755 |
|
$image_wrong_src = preg_replace('|src="[^"]+"|', 'src="http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/foo.jpg"', $image); |
| 1756 |
|
|
| 1757 |
|
$this->assertSame($image_wrong_src, wp_make_content_images_responsive($image_wrong_src)); |
| 1758 |
|
} |
| 1759 |
|
|
| 1760 |
|
/** |
|
@@ 1763-1770 (lines=8) @@
|
| 1760 |
|
/** |
| 1761 |
|
* @ticket 33641 |
| 1762 |
|
*/ |
| 1763 |
|
function test_wp_make_content_images_responsive_with_preexisting_srcset() |
| 1764 |
|
{ |
| 1765 |
|
// Generate HTML and add a dummy srcset attribute. |
| 1766 |
|
$image_html = get_image_tag(self::$large_id, '', '', '', 'medium'); |
| 1767 |
|
$image_html = preg_replace('|<img ([^>]+) />|', '<img $1 ' . 'srcset="image2x.jpg 2x" />', $image_html); |
| 1768 |
|
|
| 1769 |
|
// The content filter should return the image unchanged. |
| 1770 |
|
$this->assertSame($image_html, wp_make_content_images_responsive($image_html)); |
| 1771 |
|
} |
| 1772 |
|
|
| 1773 |
|
/** |