expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('as'); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('A none-existing character throws a InvalidArgumentException')] public function testNotExistingGetCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('a'); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('Only single characters can be set in the dictionary. Multiple characters throw a InvalidArgumentException')] public function testInvalidSetCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('as', 'test'); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('Dictionary elements cannot be overwritten and throw a InvalidArgumentException')] public function testInvalidSetDuplicateCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('a', '1'); $dict->set('a', '1'); } #[\PHPUnit\Framework\Attributes\Group('framework')] #[\PHPUnit\Framework\Attributes\TestDox('Invalid dictionary values throw a InvalidArgumentException')] public function testInvalidFormattedValue() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('a', '1a'); } }