Skip to content

Commit

Permalink
Test amp_auto_lightbox_disabled being filtered true
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Mar 9, 2022
1 parent e02a9f9 commit 7a3d259
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/php/test-amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1911,20 +1911,15 @@ static function( $classes ) {
* @covers ::amp_get_content_sanitizers()
*/
public function test_amp_get_content_sanitizers_for_lightbox_sanitizer() {
$this->assertArrayHasKey( AMP_Auto_Lightbox_Disable_Sanitizer::class, amp_get_content_sanitizers() );

add_filter( 'amp_auto_lightbox_disabled', '__return_false' );
add_filter( 'amp_auto_lightbox_disabled', '__return_false', 10 );

$this->assertArrayNotHasKey(
AMP_Auto_Lightbox_Disable_Sanitizer::class,
amp_get_content_sanitizers()
);
$this->assertArrayNotHasKey( AMP_Auto_Lightbox_Disable_Sanitizer::class, amp_get_content_sanitizers() );

remove_all_filters( 'amp_auto_lightbox_disabled' );
add_filter( 'amp_auto_lightbox_disabled', '__return_true', 20 );

$this->assertArrayHasKey(
AMP_Auto_Lightbox_Disable_Sanitizer::class,
amp_get_content_sanitizers()
);
$this->assertArrayHasKey( AMP_Auto_Lightbox_Disable_Sanitizer::class, amp_get_content_sanitizers() );
}

/**
Expand Down

0 comments on commit 7a3d259

Please sign in to comment.