Skip to content

Commit

Permalink
Update IsEqualHtmlTest
Browse files Browse the repository at this point in the history
  • Loading branch information
unfulvio-godaddy committed Jan 3, 2023
1 parent 2ea83c5 commit ad4be32
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Unit/WP_Mock/Tools/Constraints/IsEqualHtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPUnit\Framework\ExpectationFailedException;
use ReflectionException;
use ReflectionMethod;
use ReflectionProperty;
use WP_Mock\Tests\WP_MockTestCase;
use WP_Mock\Tools\Constraints\IsEqualHtml;

Expand All @@ -15,6 +16,30 @@
*/
final class IsEqualHtmlTest extends WP_MockTestCase
{
/**
* @covers \WP_Mock\Tools\Constraints\IsEqualHtml::__construct()
*
* @return void
* @throws ReflectionException|Exception
*/
public function testConstructor(): void
{
$props = [
'value' => 'Test',
'delta' => 1.2,
'canonicalize' => true,
'ignoreCase' => true,
];

$constraint = new IsEqualHtml($props['value'], $props['delta'], $props['canonicalize'], $props['ignoreCase']);

foreach ($props as $key => $value) {
$property = new ReflectionProperty($constraint, $key);

$this->assertSame($value, $property->getValue($constraint));
}
}

/**
* @covers \WP_Mock\Tools\Constraints\IsEqualHtml::clean()
*
Expand Down

0 comments on commit ad4be32

Please sign in to comment.