Skip to content

Commit

Permalink
Adjust unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Oct 6, 2023
1 parent 02b9e7d commit cae07a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/php/features/TestComments.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@ public function testRequirementsStatus() {
* @group comments
*/
public function testIsVisible() {
$this->assertTrue( $this->get_feature()->is_visible() );
$this->assertFalse( $this->get_feature()->is_visible() );

$change_visibility = function ( $is_visible, $feature_slug, $feature ) {
$this->assertTrue( $is_visible );
$this->assertFalse( $is_visible );
$this->assertSame( 'comments', $feature_slug );
$this->assertInstanceOf( '\ElasticPress\Feature\Comments\Comments', $feature );
return false;
return true;
};
add_filter( 'ep_feature_is_visible', $change_visibility, 10, 3 );

$this->assertFalse( $this->get_feature()->is_visible() );
$this->assertTrue( $this->get_feature()->is_visible() );
}

/**
Expand All @@ -188,16 +188,16 @@ public function testIsVisible() {
* @group comments
*/
public function testIsAvailable() {
$this->assertTrue( $this->get_feature()->is_available() );
$this->assertFalse( $this->get_feature()->is_available() );

$change_availability = function ( $is_available, $feature_slug, $feature ) {
$this->assertTrue( $is_available );
$this->assertFalse( $is_available );
$this->assertSame( 'comments', $feature_slug );
$this->assertInstanceOf( '\ElasticPress\Feature\Comments\Comments', $feature );
return false;
return true;
};
add_filter( 'ep_feature_is_available', $change_availability, 10, 3 );

$this->assertFalse( $this->get_feature()->is_available() );
$this->assertTrue( $this->get_feature()->is_available() );
}
}

0 comments on commit cae07a6

Please sign in to comment.