Skip to content

Commit

Permalink
Cover private constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Feb 23, 2024
1 parent c883425 commit 5dac016
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/Unit/Reference/TagReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,21 @@

final class TagReferenceTest extends TestCase
{
public function testClosedConstructor(): void
public function testConstructorIsPrivate(): void
{
$this->expectException(Error::class);
new TagReference();
}

public function testConstructor(): void
{
$reflection = new \ReflectionClass(TagReference::class);
$reflectionMethod = $reflection->getConstructor();
$this->assertTrue($reflectionMethod->isPrivate());

$reflectionMethod->invoke($reflection->newInstanceWithoutConstructor());
}

public function testAliases(): void
{
$this->assertFalse(TagReference::isTagAlias('test'));
Expand Down

0 comments on commit 5dac016

Please sign in to comment.