Skip to content

Commit

Permalink
Fix unit tests (#4564)
Browse files Browse the repository at this point in the history
* Fix unit tests

* Add loading attribute depending on WP version

(cherry picked from commit 4f9ac9c)
  • Loading branch information
pierlon committed May 22, 2020
1 parent bb0a315 commit f2fd17d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/php/test-amp-gallery-embed.php
Expand Up @@ -41,7 +41,7 @@ public function tearDown() {
*/
public function get_conversion_data() {
$amp_carousel_caption = '<span class="amp-wp-gallery-caption"><span>' . self::CAPTION_TEXT . '</span></span>';
$loading_attribute = version_compare( get_bloginfo( 'version' ), '5.5', '>' ) ? 'loading="lazy"' : '';
$loading_attribute = version_compare( get_bloginfo( 'version' ), '5.4', '>' ) ? 'loading="lazy"' : '';

return [
'shortcode_with_invalid_id' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/test-class-amp-youtube-embed-handler.php
Expand Up @@ -135,7 +135,7 @@ public function test_video_override() {
}

public function get_conversion_data() {
$loading_attribute = version_compare( get_bloginfo( 'version' ), '5.5', '>' ) ? 'loading="lazy" ' : '';
$loading_attribute = version_compare( get_bloginfo( 'version' ), '5.4', '>' ) ? 'loading="lazy" ' : '';

return [
'no_embed' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/validation/test-class-amp-validation-manager.php
Expand Up @@ -1610,7 +1610,7 @@ public function test_decorate_shortcode_and_filter_source() {
[
'type' => 'core',
'name' => 'wp-includes',
'function' => version_compare( get_bloginfo( 'version' ), '5.5', '>' ) ? 'wp_filter_content_tags' : 'wp_make_content_images_responsive',
'function' => version_compare( get_bloginfo( 'version' ), '5.4', '>' ) ? 'wp_filter_content_tags' : 'wp_make_content_images_responsive',
],
[
'type' => 'core',
Expand Down

0 comments on commit f2fd17d

Please sign in to comment.