assertEquals(self::BASIC_BENCODED_ENCODED, Bencode::encode($test)); } public function testDoubleBencodedProperty(): void { $this->expectException(RuntimeException::class); $test = new class implements BencodeSerializable { use BencodeSerializableTrait; #[BencodeProperty('test1')] #[BencodeProperty('test2')] // @phpstan-ignore-line: this is meant to test the dupe exception public string $stringVal = 'string value'; #[BencodeProperty('test3')] #[BencodeProperty('test4')] // @phpstan-ignore-line: this is meant to test the dupe exception public function getIntVal(): int { return 1234; } }; Bencode::encode($test); } public function testDuplicateBencodedProperty(): void { $this->expectException(RuntimeException::class); $test = new class implements BencodeSerializable { use BencodeSerializableTrait; #[BencodeProperty] public string $test1 = 'string value'; #[BencodeProperty('test1')] public function getIntVal(): int { return 1234; } }; Bencode::encode($test); } }