diff --git a/tests/test-picture.php b/tests/test-picture.php index 8af36c8..ff3fc14 100644 --- a/tests/test-picture.php +++ b/tests/test-picture.php @@ -1,5 +1,7 @@ assertEquals( $expected, $result ); } + public function test_picture_webp_args_array_with_srcset_descriptors() { + $attachment = $this->create_image(); + $result = get_timber_picture_responsive( $attachment, [ + 'resize' => [ 260 ], + 'srcset' => [ '1x', '2x' ], + 'webp' => true, + ] ); + + $expected = '' . PHP_EOL . '' . PHP_EOL . ''; + + $this->assertEquals( $expected, $result ); + } + + public function test_picture_webp_args_array_with_srcset_descriptors_timmy_image() { + $attachment = $this->create_image(); + $image = Timmy::get_image( $attachment, [ + 'resize' => [ 260 ], + 'srcset' => [ '1x', '2x' ], + 'webp' => true, + ] ); + + $result = $image->picture_responsive(); + + $expected = '' . PHP_EOL . '' . PHP_EOL . ''; + + $this->assertEquals( $expected, $result ); + } + public function test_picture_loading_false() { $attachment = $this->create_image(); $result = get_timber_picture_responsive( $attachment, 'picture', [ 'loading' => false ] ); @@ -66,8 +96,8 @@ public function test_picture_loading_false() { public function test_picture_loading_false_timmy_image() { $attachment = $this->create_image(); - $image = Timmy\Timmy::get_image( $attachment->ID, 'picture' ); - $result = $image->picture_responsive( [ 'loading' => false ] ); + $image = Timmy::get_image( $attachment->ID, 'picture' ); + $result = $image->picture_responsive( [ 'loading' => false ] ); $expected = '' . PHP_EOL . '';