Skip to content

Commit

Permalink
Readonly: Protected coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Nov 10, 2022
1 parent e928d2c commit 767350c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Fixtures/Php81TestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
class Php81TestClass
{
public readonly string $a;
private readonly string $b;
protected readonly string $b;
private readonly string $c;

public function __construct(string $a)
{
$this->a = $a;
$this->b = $a.$a;
$this->c = $a.$a.$a;
}

public function typeHints(X & Y $p1)
Expand Down
5 changes: 5 additions & 0 deletions tests/Parser/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ public function testParseObjectIncomplete()
$this->assertSame('test', $val[1]->value->contents);
}

/**
* @covers \Kint\Parser\Parser::parseObject
*/
public function testParseObjectReadonly()
{
if (!KINT_PHP81) {
Expand All @@ -511,6 +514,8 @@ public function testParseObjectReadonly()
$this->assertTrue($val[0]->readonly);
$this->assertSame('b', $val[1]->name);
$this->assertTrue($val[1]->readonly);
$this->assertSame('c', $val[2]->name);
$this->assertTrue($val[2]->readonly);
}

/**
Expand Down

0 comments on commit 767350c

Please sign in to comment.