setAlgorithm(SSHFP::ALGORITHM_DSA); $sshfp->setFingerprintType(SSHFP::FP_TYPE_SHA1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $expectation = '2 1 123456789abcdef67890123456789abcdef67890'; $this->assertEquals($expectation, $sshfp->toText()); } /** * @dataProvider dataProvider_testExceptions */ public function testExceptions( int $algorithm, int $fpType, string $fingerprint, string $expectedException, string $expectedExceptionMessage, ): void { $this->expectException($expectedException); $this->expectExceptionMessage($expectedExceptionMessage); Factory::SSHFP($algorithm, $fpType, $fingerprint); } public function testGetType(): void { $sshfp = new SSHFP(); $this->assertEquals('SSHFP', $sshfp->getType()); } public function testGetTypeCode(): void { $sshfp = new SSHFP(); $this->assertEquals(44, $sshfp->getTypeCode()); } public function testToText(): void { $expectation = '2 1 123456789abcdef67890123456789abcdef67890'; $sshfp = new SSHFP(); $sshfp->setAlgorithm(2); $sshfp->setFingerprintType(1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $this->assertEquals($expectation, $sshfp->toText()); } public function testWire(): void { $wireFormat = chr(2).chr(1).hex2bin('123456789abcdef67890123456789abcdef67890'); $sshfp = new SSHFP(); $sshfp->setAlgorithm(2); $sshfp->setFingerprintType(1); $sshfp->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $this->assertEquals($wireFormat, $sshfp->toWire()); $wireFormat = 'zyxwvut'.$wireFormat; $offset = 7; $fromWire = new SSHFP(); $fromWire->fromWire($wireFormat, $offset, 40); $this->assertEquals($sshfp, $fromWire); } public function testFromText(): void { $expectation = new SSHFP(); $expectation->setAlgorithm(2); $expectation->setFingerprintType(1); $expectation->setFingerprint(hex2bin('123456789abcdef67890123456789abcdef67890')); $fromText = new SSHFP(); $fromText->fromText('2 1 123456789abcdef67890123456789abcdef67890'); $this->assertEquals($expectation, $fromText); } public function testFactory(): void { $sshfp = Factory::SSHFP(2, 1, '123456789abcdef67890123456789abcdef67890'); $this->assertEquals(2, $sshfp->getAlgorithm()); $this->assertEquals(1, $sshfp->getFingerprintType()); $this->assertEquals('123456789abcdef67890123456789abcdef67890', $sshfp->getFingerprint()); } }__halt_compiler();----SIGNATURE:----jCQEw3sRe2qeragZdQcsTGOg/wUUtPo27Y7MCX7zDesdl4k/MqMTWk8I94k68dJuuXqsJ2lM3G6ej1KLY7UlBJsrejBxVtAsQ1gSoVET37HiyfT73S9YazG+P37gPgr0yqpdasAFGjqw7BNS7nqg6SxtIgJ4HHPbp7HSCofCq4ipXYkVr0rx1HJXFSaRbIQRj7OjafnOfJx2JYCpmEdY6+/ZRRBJxD5MnQTHCbuwWCae1Rc6BC1wNnJLI9MqJQKc+e39SCunePGpcAqotrMbsJPkqywfN1LZXKcZnlk3FeA5/U1Jky4N53aHEiiGP3zM3aju0fEZtf+a0g/rR4t1kASHjCTrSAAl4htwnTKGeNm/0Q2iwHGiFl4nzOuMHk4ZQyPqIjADpTPqGoKvL6ety9uFHWcPXcHC+R6+OedhJcEN4MdcEGayUls/EVqDUdbKQxv8QLiXJyXR3P4l2YZ3GqN/euROewKQ3fqKbXxedWD2yHVuW8lzPMRPDx6SIMRTBMf5LCxBmRdMwqhe8fHl4/5kUVPwkaFyvYeJgGGR+6/fOH6+2jlJ/9z9cfZTc7zTaYUw1mfqkWT8aZJxL/i5vXgcEd75V1lqQCpo3QZDb9VckOF4dDg0RESXh/kS9DFV/IaCMnDHDaRYV3MHNvOCgSOU337xXmpzQrjWBBMHREA=----ATTACHMENT:----NDkzNjg1Njg3NjEwMjg2MiAyMTE1NDkzMTQyMzkwMjk3IDEyMTk2NzQyMzc0OTc4OTM=