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')] public string $stringVal = 'string value'; #[BencodeProperty('test3')] #[BencodeProperty('test4')] 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); } }