expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('as'); } /** * @testdox A none-existing character throws a InvalidArgumentException * @covers phpOMS\Utils\Encoding\Huffman\Dictionary * @group framework */ public function testNotExistingGetCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->get('a'); } /** * @testdox Only single characters can be set in the dictionary. Multiple characters throw a InvalidArgumentException * @covers phpOMS\Utils\Encoding\Huffman\Dictionary * @group framework */ public function testInvalidSetCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('as', 'test'); } /** * @testdox Dictionary elements cannot be overwritten and throw a InvalidArgumentException * @covers phpOMS\Utils\Encoding\Huffman\Dictionary * @group framework */ public function testInvalidSetDuplicateCharacter() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('a', '1'); $dict->set('a', '1'); } /** * @testdox Invalid dictionary values throw a InvalidArgumentException * @covers phpOMS\Utils\Encoding\Huffman\Dictionary * @group framework */ public function testInvalidFormattedValue() : void { $this->expectException(\InvalidArgumentException::class); $dict = new Dictionary(); $dict->set('a', '1a'); } }