Commit Graph

6 Commits

Author SHA1 Message Date
Scott Taylor fabd554bb2 Merge the Responsive Images feature plugin into core, initial commit. See: https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images/
New functions in `media.php`:
* `wp_get_attachment_image_srcset_array()` - Returns an array of image candidate string data used to build a `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_srcset()` - Returns the `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_sizes()` - Returns the `sizes` value for an attachment given an `$attachement_id` and `$size` and optional arguments used to alter its output.
* `wp_make_content_images_responsive()` - A display filter for adding `srcset` and `sizes` to images embedded in content.
* `wp_img_add_srcset_and_sizes()` - A utility function used by `wp_make_content_images_responsive()` to add `srcset` and `sizes` to a single `<img>` element.

Modifies existing core functions:
* Modify `wp_get_attachment_image()` so the HTML returned for an image includes `srcset` and `sizes`.
* Modify `get_media_embedded_in_content()` (sup, 3.6 leftover) by adding `<img>` to the list of accepted tags that can be matched in content. This is used in `wp_make_content_images_responsive()` to find all of the images embedded in content before passing them off to `wp_img_add_srcset_and_sizes()`.

Tests:
* Add a new factory method to `WP_UnitTest_Factory_For_Attachment` named `create_upload_object()`
* Adds unit tests
* Updates unit tests

Props joemcgill, tevko, jaspermdegroot, mdmcginn, barryceelen, peterwilsoncc, fsylum, wonderboymusic, chriscoyier, benjaminpick, jrfnl, #12kingkool68, janhenckens, ryanmarkel, side777, ryelle, wturrell, micahmills, mattbagwell, coliff, DrewAPicture.
See #33641.


git-svn-id: https://develop.svn.wordpress.org/trunk@34855 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-06 04:58:21 +00:00
Aaron Jorbin dd25cc9a7c Add test image for test_exif_keywords test
[34374] added a test that relies on a new test image. This test image wasn't included in the commit.  This fixes the broken Tests_Image_Meta::test_exif_keywords test.

Props swissspidy, SteveHoneyNZ.
Fixes #33772.



git-svn-id: https://develop.svn.wordpress.org/trunk@34448 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 21:42:45 +00:00
Sergey Biryukov 16cc16da9e Remove `svn:executable` from test files.
git-svn-id: https://develop.svn.wordpress.org/trunk@33425 602fd350-edb4-49c9-b593-d223f7449a82
2015-07-26 09:40:58 +00:00
Scott Taylor 74ec1ce5ed `tests/phpunit/data/images/a2-small-100x75.jpg` should not be checked in - it is generated in a test method and `unlink()`'d since [25507].
git-svn-id: https://develop.svn.wordpress.org/trunk@25557 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-21 18:51:55 +00:00
Scott Taylor 85881c19dc Fix the PHP 5.4 `Only variables should be passed by reference` notices in `tests/action.php`.
See #25282.



git-svn-id: https://develop.svn.wordpress.org/trunk@25373 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-12 03:53:56 +00:00
Andrew Nacin 8045afd81b Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root.

see #25088.


git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-29 18:39:34 +00:00