Skip to content

Commit

Permalink
alter test suite to accomodate single srcset case
Browse files Browse the repository at this point in the history
  • Loading branch information
tevko committed Aug 25, 2015
1 parent 5fcc197 commit 1a7f5ae
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
19 changes: 18 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,27 @@ The only external dependency included in this plugin is [Picturefill](http://sco
We use a hook because if you attempt to dequeue a script before it's enqueued, wp_dequeue_script has no effect. (If it's still being loaded, you may need to specify a [priority](http://codex.wordpress.org/Function_Reference/add_action).)

## Version
2.3.1
2.4.0

## Changelog

- Added filter for tevkori_get_sizes, with tests
- Added Composer support
- Compare aspect ratio in relative values, not absolute values
- Cleanup of code style and comments added
- Added PHP 5.2 to our Travis test matrix
- Fixed unit test loading
- Preventing duplicates in srcset array
- Updated docs for advanced image compression
- Formatting cleanup in readme.md
- Bump plugin 'Tested up to:' value to 4.3
- Remove extra line from readme.txt
- Added changelog items from 2.3.1 to the readme.txt file
- Added 'sudo: false' to travis.ci to use new TravisCI infrastructure
- Removing the srcset and sizes attributes if there is only one source present for the image

**2.3.1**

- First char no longer stripped from file name if there's no slash
- Adding test for when uploads directory not organized by date
- Don't calculate a srcset when the image data returns no width
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://app.etapestry.com/hosted/BoweryResidentsCommittee/OnlineDon
Tags: Responsive, Images, Responsive Images, SRCSET, Picturefill
Requires at least: 4.1
Tested up to: 4.3
Stable tag: 2.3.0
Stable tag: 2.4.0
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.txt

Expand Down
10 changes: 2 additions & 8 deletions tests/test-suite.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,14 @@ function test_tevkori_get_srcset_array_no_date_upoads() {
update_option( 'uploads_use_yearmonth_folders', $uploads_use_yearmonth_folders );
}

function test_tevkori_get_srcset_array_thumb() {
function test_tevkori_get_srcset_array_single_srcset() {
// make an image
$id = $this->_test_img();
$sizes = tevkori_get_srcset_array( $id, 'thumbnail' );

$image = wp_get_attachment_metadata( $id );

$year_month = date('Y/m');
$expected = array(
$image['sizes']['thumbnail']['width'] => 'http://example.org/wp-content/uploads/' . $year_month = date('Y/m') . '/'
. $image['sizes']['thumbnail']['file'] . ' ' . $image['sizes']['thumbnail']['width'] . 'w',
);

$this->assertSame( $expected, $sizes );
$this->assertFalse( $sizes );
}

function test_tevkori_get_srcset_array_false() { // make an image
Expand Down

0 comments on commit 1a7f5ae

Please sign in to comment.