Skip to content

Commit

Permalink
Fix some tests and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Jan 10, 2024
1 parent 3af9718 commit ba270dd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 54 deletions.
8 changes: 8 additions & 0 deletions tests/phpunit/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class BaseTestCase extends \WP_UnitTestCase {
*/
protected $ep_factory;

/**
* Helps us keep track of actions that have fired
*
* @var array
* @since 2.3.0
*/
protected $fired_actions = array();

/**
* Set up the test case.
*
Expand Down
13 changes: 0 additions & 13 deletions tests/phpunit/feature/TestBooleanSearchOperators.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,6 @@ public function testBoxSummary() {
$this->assertStringContainsString( 'Allow boolean operators in search queries', $output );
}

/**
* Test box long text
*
* @since 1.2.0
*/
public function testBoxLong() {
ob_start();
$this->get_feature()->output_feature_box_long();
$output = ob_get_clean();

$this->assertStringContainsString( 'Allows users to search using the following boolean operators:', $output );
}

/**
* Text query_uses_boolean_operators function
*
Expand Down
13 changes: 0 additions & 13 deletions tests/phpunit/feature/TestCoAuthorsPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ public function testBoxSummary() {
$this->assertStringContainsString( 'Add support for the Co-Authors Plus plugin in the Admin Post List screen by Author name', $output );
}

/**
* Test box long text
*
* @since 1.1.0
*/
public function testBoxLong() {
ob_start();
$this->get_feature()->output_feature_box_long();
$output = ob_get_clean();

$this->assertStringContainsString( 'If using the Co-Authors Plus plugin and the Protected Content feature, enable this feature to visit the Admin Post List screen by Author name <code>wp-admin/edit.php?author_name=&lt;name&gt;</code> and see correct results.', $output );
}

/**
* Test filter out author name and id from Elasticsearch query
*
Expand Down
27 changes: 0 additions & 27 deletions tests/phpunit/feature/TestMetaKeyPattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,6 @@ public function testBoxSummary() {
$this->assertStringContainsString( 'Include or exclude meta key patterns.', $output );
}

/**
* Test the `output_feature_box_long` method.
*
* @group MetaKeyPattern
*/
public function testBoxLong() {
ob_start();
$this->get_feature()->output_feature_box_long();
$output = ob_get_clean();

$this->assertStringContainsString( 'This feature will give you the most control over the metadata indexed.', $output );
}

/**
* Test the `output_feature_box_settings` method.
*
* @group MetaKeyPattern
*/
public function testOutputFeatureBoxSettings() {
ob_start();
$this->get_feature()->output_feature_box_settings();
$output = ob_get_clean();

$this->assertStringContainsString( 'Allow patterns', $output );
$this->assertStringContainsString( 'Deny patterns', $output );
}

/**
* Test the `is_match` method.
*
Expand Down
4 changes: 3 additions & 1 deletion tests/phpunit/indexables/TestUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ protected function get_feature() {
public function createAndIndexUsers() {
ElasticPress\Indexables::factory()->get( 'user' )->sync_manager->add_to_queue( 1 );

ElasticPress\Indexables::factory()->get( 'user' )->bulk_index( array_keys( ElasticPress\Indexables::factory()->get( 'user' )->sync_manager->sync_queue ) );
ElasticPress\Indexables::factory()->get( 'user' )->bulk_index(
array_keys( ElasticPress\Indexables::factory()->get( 'user' )->sync_manager->sync_queue[1] )
);

$user_1 = $this->ep_factory->user->create(
[
Expand Down

0 comments on commit ba270dd

Please sign in to comment.