Skip to content

Commit 93c8b58

Browse files
committed
Fixing tests so that they pass.
1 parent 136bd86 commit 93c8b58

File tree

2 files changed

+29
-36
lines changed

2 files changed

+29
-36
lines changed

tests/test-indexing.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,14 @@ public function test_index_taxonomy_terms() {
255255
wp_set_post_terms( $post_id, $cat_ids, 'category', true );
256256
wp_set_post_terms( $post_id, array( 'foo', 'bar', 'baz' ), 'post_tag', true );
257257
wp_set_post_terms( $post_id, array( 'scifi', 'fantasy', 'detective' ), 'genre', true );
258-
259258
$tag_array['tag'] = 1;
260-
if ( RELEVANSSI_PREMIUM ) {
261-
$tag_array['taxonomy_detail'] = '{"post_tag":1}';
262-
}
259+
$tag_array['taxonomy_detail'] = '{"post_tag":1}';
263260
$cat_array['category'] = 1;
264-
if ( RELEVANSSI_PREMIUM ) {
265-
$cat_array['taxonomy_detail'] = '{"category":1}';
266-
}
261+
$cat_array['taxonomy_detail'] = '{"category":1}';
267262
$genre_array_pre['taxonomy'] = 1;
268-
if ( RELEVANSSI_PREMIUM ) {
269-
$genre_array_pre['taxonomy_detail'] = '{"genre":1}';
270-
}
263+
$genre_array_pre['taxonomy_detail'] = '{"genre":1}';
271264
$genre_array_post['taxonomy'] = 2;
272-
if ( RELEVANSSI_PREMIUM ) {
273-
$genre_array_post['taxonomy_detail'] = '{"genre":2}';
274-
}
265+
$genre_array_post['taxonomy_detail'] = '{"genre":2}';
275266

276267
$this->assertEquals(
277268
array(

tests/test-searching.php

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,34 +1958,36 @@ public function test_compile_search_args() {
19581958
'date_query is not interpreted correctly.'
19591959
);
19601960

1961-
$args = array(
1962-
's' => 'content',
1963-
'operator' => 'or',
1964-
);
1961+
if ( RELEVANSSI_PREMIUM ) {
1962+
$args = array(
1963+
's' => 'content',
1964+
'operator' => 'or',
1965+
);
19651966

1966-
$query->parse_query( $args );
1967-
$search_params = relevanssi_compile_search_args( $query, $args['s'] );
1967+
$query->parse_query( $args );
1968+
$search_params = relevanssi_compile_search_args( $query, $args['s'] );
19681969

1969-
$this->assertEquals(
1970-
'OR',
1971-
$search_params['operator'],
1972-
'operator is not interpreted correctly.'
1973-
);
1970+
$this->assertEquals(
1971+
'OR',
1972+
$search_params['operator'],
1973+
'operator is not interpreted correctly.'
1974+
);
19741975

1975-
update_option( 'relevanssi_implicit_operator', 'AND' );
1976-
$args = array(
1977-
's' => 'content',
1978-
'operator' => 'smooth',
1979-
);
1976+
update_option( 'relevanssi_implicit_operator', 'AND' );
1977+
$args = array(
1978+
's' => 'content',
1979+
'operator' => 'smooth',
1980+
);
19801981

1981-
$query->parse_query( $args );
1982-
$search_params = relevanssi_compile_search_args( $query, $args['s'] );
1982+
$query->parse_query( $args );
1983+
$search_params = relevanssi_compile_search_args( $query, $args['s'] );
19831984

1984-
$this->assertEquals(
1985-
'AND',
1986-
$search_params['operator'],
1987-
'operator is not interpreted correctly.'
1988-
);
1985+
$this->assertEquals(
1986+
'AND',
1987+
$search_params['operator'],
1988+
'operator is not interpreted correctly.'
1989+
);
1990+
}
19891991

19901992
$args = array(
19911993
's' => 'content',

0 commit comments

Comments
 (0)