|
@@ 294-303 (lines=10) @@
|
| 291 |
|
* |
| 292 |
|
* @dataProvider get_dont_process_images_with_classes_data |
| 293 |
|
*/ |
| 294 |
|
public function test_dont_process_images_with_classes( $input, $should_skip = true ) { |
| 295 |
|
$instance = Jetpack_Lazy_Images::instance(); |
| 296 |
|
$output = $instance->add_image_placeholders( $input ); |
| 297 |
|
|
| 298 |
|
if ( $should_skip ) { |
| 299 |
|
$this->assertNotContains( 'srcset="placeholder.jpg"', $output ); |
| 300 |
|
} else { |
| 301 |
|
$this->assertContains( 'srcset="placeholder.jpg"', $output ); |
| 302 |
|
} |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
/** |
| 306 |
|
* Data provider for test. |
|
@@ 333-342 (lines=10) @@
|
| 330 |
|
* |
| 331 |
|
* @dataProvider get_dont_process_images_with_skip_lazy_data_attribute_data |
| 332 |
|
*/ |
| 333 |
|
public function test_dont_process_images_with_skip_lazy_data_attribute( $input, $should_skip = true ) { |
| 334 |
|
$instance = Jetpack_Lazy_Images::instance(); |
| 335 |
|
$output = $instance->add_image_placeholders( $input ); |
| 336 |
|
|
| 337 |
|
if ( $should_skip ) { |
| 338 |
|
$this->assertNotContains( 'srcset="placeholder.jpg"', $output ); |
| 339 |
|
} else { |
| 340 |
|
$this->assertContains( 'srcset="placeholder.jpg"', $output ); |
| 341 |
|
} |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
/** |
| 345 |
|
* Data provider for test. |