From 767350cb8472e3cadfea40700b6fa9be33a76fd2 Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Thu, 10 Nov 2022 14:49:52 +0100 Subject: [PATCH] Readonly: Protected coverage --- tests/Fixtures/Php81TestClass.php | 4 +++- tests/Parser/ParserTest.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/Fixtures/Php81TestClass.php b/tests/Fixtures/Php81TestClass.php index 455ec0e8f..a052ec443 100644 --- a/tests/Fixtures/Php81TestClass.php +++ b/tests/Fixtures/Php81TestClass.php @@ -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) diff --git a/tests/Parser/ParserTest.php b/tests/Parser/ParserTest.php index 570d5b8ae..f2c06d883 100644 --- a/tests/Parser/ParserTest.php +++ b/tests/Parser/ParserTest.php @@ -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) { @@ -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); } /**