assertEquals('DHCID', $dhcid->getType()); } public function testGetTypeCode(): void { $dhcid = new DHCID(); $this->assertEquals(49, $dhcid->getTypeCode()); } /** * @dataProvider getDataProvider * * @param string $text * @param int $identifierType * @param string $identifier * @param string $fqdn */ public function testToText(string $text, int $identifierType, string $identifier, string $fqdn): void { $dhcid = new DHCID(); $dhcid->setIdentifier($identifierType, $identifier); $dhcid->setFqdn($fqdn); $this->assertEquals($text, $dhcid->toText()); } /** * @dataProvider getDataProvider * * @param string $text * @param int $identifierType * @param string $identifier * @param string $fqdn */ public function testToFromWire(string $text, int $identifierType, string $identifier, string $fqdn): void { $expectation = new DHCID(); $expectation->setIdentifier($identifierType, $identifier); $expectation->setFqdn($fqdn); $dhcid = DHCID::fromWire($expectation->toWire()); $this->assertEquals($expectation->getIdentifierType(), $dhcid->getIdentifierType()); $this->assertEquals($expectation->getDigestType(), $dhcid->getDigestType()); $this->assertEquals($expectation->getDigest(), $dhcid->getDigest()); $this->assertEquals($expectation->toText(), $dhcid->toText()); $this->assertEquals($text, $dhcid->toText()); } /** * @dataProvider getDataProvider * * @param string $text * @param int $identifierType * @param string $identifier * @param string $fqdn * * @throws \Exception */ public function testFromText(string $text, int $identifierType, string $identifier, string $fqdn): void { $expectation = new DHCID(); $expectation->setIdentifier($identifierType, $identifier); $expectation->setFqdn($fqdn); $expectation->calculateDigest(); $dhcid = DHCID::fromText($text); $this->assertEquals($expectation->getIdentifierType(), $dhcid->getIdentifierType()); $this->assertEquals($expectation->getDigestType(), $dhcid->getDigestType()); $this->assertEquals($expectation->getDigest(), $dhcid->getDigest()); $this->assertEquals($expectation->toText(), $dhcid->toText()); } /** * @dataProvider getDataProvider * * @param string $text * @param int $identifierType * @param string $identifier * @param string $fqdn */ public function testFactory(string $text, int $identifierType, string $identifier, string $fqdn): void { $dhcid = Factory::DHCID(null, $identifierType, $identifier, $fqdn); $this->assertEquals($text, $dhcid->toText()); $digest = $dhcid->getDigest(); $_dhcid = Factory::DHCID($digest, $identifierType); $this->assertEquals($dhcid->toText(), $_dhcid->toText()); } public function testFactoryThrowsExceptionIfIdAndFqdnAreNull(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Identifier and FQDN cannot be null if digest is null.'); $dhcid = Factory::DHCID(null, 2, null); } } __halt_compiler();----SIGNATURE:----D6BFM5pL+G4WDbreTjCHUT/r+ySZZVsS+HMp+bliZa4jct8GDIGbWNdQ/ySoTqK+B8xfQP8TwXa+bZmctPVCcVyBRkjH2WdLoEYJrXbN7qcq/Y4YCCXc4zxur52VkWqzGHGyzqgdbvHNbnQbhYUH1/YQap7nIqadrXkWHusmH2Luuk4ZtmZZGAweGMD9jIYcbSuKv61nUVL19GUvdqmu5zQwN40tF2lDoP1Mj4x4iHsCdAKwCM23ktGW21ysY2GatE3T4SbDsOG7XUig/vixThcGMa9CTp2uGM1+Nl4eJaOg4DhiVpLAWZytfUVtzqEVUFWZO01/ZROhequb//+Nqt5Bzh1BBuUuXaC6EW6/cgqUvlZ79qvJsBNx7Sx5jfmVSfyhirCEnuyIUJKJ337XbWVfdhHww9J7n4jia8zOcSOEjaBzEH1Oaqtj1xjTOTv1CR3jG0Ew1awO6anHN7Xp8KjTt4ria4Wq/4TC5w6o6+c4L5Iq6LD2A6JnfGT7vuQkj7Wgme/ZOB33yms19hfYCRwOxjq+scu9ufmj/p/r8MLNqtdgnOoCx1TZQeAY6wBk0QzEqtjIzHzMhMQ2afwM2acKz2gdJWio7EiUzg+/HZQYQroRwVyn7H4zAds8vL1BA54ZotEmyeE+lSjkkT7k/+zzw6q9edFOiC/ix5RkSzU=----ATTACHMENT:----NTU1NzMyOTI0OTU2NTMwMSA1MTQ2ODc5OTQ3Njc4NzA4IDU0NTc3MTQ3ODQ3NTg1MTg=