Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sathyapulse committed Nov 29, 2024
1 parent 9c0c3db commit 7fe0523
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/search/includes/classes/test-class-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,13 @@ public function test__ep_skip_post_meta_sync_filter_should_return_true_if_meta_n

$this->init_es();

$this->assertTrue( apply_filters( 'ep_skip_post_meta_sync', false, $post, 40, 'random_key', 'random_value' ) );
add_filter( 'ep_do_intercept_request', [ $this, 'filter_ok_es_requests' ], PHP_INT_MAX, 5 );

$result = apply_filters( 'ep_skip_post_meta_sync', false, $post, 40, 'random_key', 'random_value' );

remove_filter( 'ep_do_intercept_request', [ $this, 'filter_ok_es_requests' ], PHP_INT_MAX );

$this->assertTrue( $result );
}

public function test__ep_skip_post_meta_sync_filter_should_return_false_if_meta_is_in_allow_list() {
Expand Down Expand Up @@ -1793,7 +1799,13 @@ public function test__ep_skip_post_meta_sync_filter_should_return_true_if_a_prev

$this->init_es();

$this->assertTrue( apply_filters( 'ep_skip_post_meta_sync', true, $post, 40, 'random_key', 'random_value' ) );
add_filter( 'ep_do_intercept_request', [ $this, 'filter_ok_es_requests' ], PHP_INT_MAX, 5 );

$result = apply_filters( 'ep_skip_post_meta_sync', true, $post, 40, 'random_key', 'random_value' );

remove_filter( 'ep_do_intercept_request', [ $this, 'filter_ok_es_requests' ], PHP_INT_MAX );

$this->assertTrue( $result );
}

public function filter__ep_prepare_meta_allowed_protected_keys__should_use_post_meta_allow_list_data() {
Expand Down

0 comments on commit 7fe0523

Please sign in to comment.