assertEquals($expectation, $caa->toText()); $this->assertEquals(0, $caa->getFlag()); $this->assertEquals('issue', $caa->getTag()); } /** * @throws \InvalidArgumentException */ public function testFlagException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Flag must be an unsigned 8-bit integer.'); $srv = new CAA(); $srv->setFlag(256); } /** * @throws \InvalidArgumentException */ public function testTagException(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Tag can be one of this type "issue", "issuewild", or "iodef".'); $srv = new CAA(); $srv->setTag('not_exist'); } public function testGetType(): void { $this->assertEquals('CAA', (new CAA())->getType()); } public function testFromText(): void { $text = '0 iodef "mailto:security@example.com"'; /** @var CAA $caa */ $caa = CAA::fromText($text); $this->assertEquals(0, $caa->getFlag()); $this->assertEquals(CAA::TAG_IODEF, $caa->getTag()); $this->assertEquals('mailto:security@example.com', $caa->getValue()); } public function testWire(): void { $expectation = chr(0).chr(5).'iodef'.'mailto:security@example.com'; $caa = new CAA(); $caa->setFlag(0); $caa->setTag(CAA::TAG_IODEF); $caa->setValue('mailto:security@example.com'); $this->assertEquals($expectation, $caa->toWire()); $this->assertEquals($caa, CAA::fromWire($expectation)); } } __halt_compiler();----SIGNATURE:----V6NlJZw1PFSHvqWcKJkuxhoUzqwf8clEMWGqY4MyBXXmTpVYTUWf5bDK58+5QMTbJbeLm6xywH9xiZckslnJJhPoZlzE+ZdIqXnADlQ8BNy0LCUhsWL0EsB+3Bu5YJHgBq/3+H9mAiOeJ2yQeeHrNXAtmUOtfFTzemGyd/tsR60VS66af8pNykPckeIGavy5FblKNhQbf/ML8UAM7YePOvGg/ymjLAyb5tJ4CeTBRyr7t97g4YQF/81ov23hzjqFr4hlSEKv8OD4f9g9AI6TQdW8GuEhBlGtxYo70Y07120VgvOyfdelUYm1+lA1DE9imiD37S/974IRPwUjgQHxtF+vJM2cVYRFk5LKhrKh2oW+90qg2mTLClKxTMWJT+Rx50QQNB7l83I/r9KQ1ytQuYw19eKlI8mIfPMQNVKRv8H+jZj5bkbWukYMZh+sv4C0UiLZwhdLusMGd0Cqdi2polAyjvTcYd/O3cIlwZ3PmDHsHy376qUgEmTGFvm9nRUIh6Niqp2ZjC5WMBS22RRFqPXpYX3qfPgmJIJRme+iFMAJjnJ3BYqn2QZDfy4g7YEOSdtB78vwvKtc5XH06AW/rIZAuuOM3qJtWrHCUNS5vVtEWdTbMmWR1Je2Z+OBNqPmVH+Zh6dNsgaOkztDYnnvuo5GGvju/f6C9RlynmDkYkU=----ATTACHMENT:----NDUxNTA5MTU0MjkzMTU5NSA2NDU0MDY4NDMxNzY4NzM2IDUzNjI4Njk5NjMxMDQ3Mzk=