Skip to content

Commit

Permalink
Add missing tests for lazy-load script/style functions
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 30, 2024
1 parent 4d70ad0 commit c1491ad
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions plugins/image-prioritizer/tests/test-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,31 @@ public function test_auto_sizes( array $element_metrics, string $buffer, string
"Buffer snapshot:\n$buffer"
);
}

/**
* Test image_prioritizer_get_video_lazy_load_script.
*
* @covers ::image_prioritizer_get_video_lazy_load_script
*/
public function test_image_prioritizer_get_video_lazy_load_script(): void {
$this->assertGreaterThan( 0, strlen( image_prioritizer_get_video_lazy_load_script() ) );
}

/**
* Test image_prioritizer_get_lazy_load_bg_image_script.
*
* @covers ::image_prioritizer_get_lazy_load_bg_image_script
*/
public function test_image_prioritizer_get_lazy_load_bg_image_script(): void {
$this->assertGreaterThan( 0, strlen( image_prioritizer_get_lazy_load_bg_image_script() ) );
}

/**
* Test image_prioritizer_get_lazy_load_bg_image_stylesheet.
*
* @covers ::image_prioritizer_get_lazy_load_bg_image_stylesheet
*/
public function test_image_prioritizer_get_lazy_load_bg_image_stylesheet(): void {
$this->assertGreaterThan( 0, strlen( image_prioritizer_get_lazy_load_bg_image_stylesheet() ) );
}
}

0 comments on commit c1491ad

Please sign in to comment.