Skip to content

Commit

Permalink
Improve assertion accuracy for what is being tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
costdev committed Jun 9, 2024
1 parent 7534c53 commit dfcf36d
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public function test_should_return_empty_string_without_proper_capabilities() {
true
);

$this->assertSame( '', $actual, 'No button markup should be returned.' );
$this->assertIsString( $actual, 'A string should be returned.' );
$this->assertSame( '', $actual, 'An empty string should be returned.' );
}

/**
Expand Down Expand Up @@ -113,7 +114,8 @@ public function test_should_not_return_empty_string_with_proper_capabilities_sin

self::$role->remove_cap( $capability );

$this->assertNotSame( '', $actual, 'Button markup should be returned.' );
$this->assertIsString( $actual, 'A string should be returned.' );
$this->assertNotSame( '', $actual, 'An empty string should not be returned.' );
}

/**
Expand Down Expand Up @@ -147,6 +149,7 @@ public function test_should_not_return_empty_string_with_proper_capabilities_mul

revoke_super_admin( self::$user_id );

$this->assertNotSame( '', $actual, 'Button markup should be returned.' );
$this->assertIsString( $actual, 'A string should be returned.' );
$this->assertNotSame( '', $actual, 'An empty string should not be returned.' );
}
}

0 comments on commit dfcf36d

Please sign in to comment.