setAlgorithm(SSHFP::ALGORITHM_DSA); $sshfp->setFingerprintType(SSHFP::FP_TYPE_SHA1); $sshfp->setFingerprint('123456789abcdef67890123456789abcdef67890'); $expectation = '2 1 123456789abcdef67890123456789abcdef67890'; $this->assertEquals($expectation, $sshfp->toText()); } /** * @dataProvider dataProvider_testExceptions * * @param int $algorithm * @param int $fpType * @param string $fingerprint * @param string $expectedException * @param string $expectedExceptionMessage */ 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('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('123456789abcdef67890123456789abcdef67890'); $this->assertEquals($wireFormat, $sshfp->toWire()); $wireFormat = 'zyxwvut'.$wireFormat; $offset = 7; $this->assertEquals($sshfp, SSHFP::fromWire($wireFormat, $offset, 40)); } public function testFromText(): void { $expectation = new SSHFP(); $expectation->setAlgorithm(2); $expectation->setFingerprintType(1); $expectation->setFingerprint('123456789abcdef67890123456789abcdef67890'); $this->assertEquals($expectation, SSHFP::fromText('2 1 123456789abcdef67890123456789abcdef67890')); } 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:----kzuO2nvWlTnc4RnOY4MFk4QmkdhHdTePUoDYLu3Av598rO0RINqta/FIKBDlowAAMNtjM8eW270IQ9LQPCTceV9w1Q1mqp3OPAokPWzDwK9i3bQPlRoDZ9rMzyViMShixdhw36cITkNA5/CXj2UMr6uho+7kdd/tsBzKKMxig1lMBzsLY9I8JIs+kmyPHhHEUO26o8bQW3vvc6gGJnP7HdVMy2NyDWfHxYyPY2zns/YAJa/99orJ/KEV7Fkq9gQ0rF5KI+MzRMwLh1FmwNQHtqvE5z0Pkq4z2ME4QdyvOB/i43FzdU+B0oYIrvH/P6cchym/KtA37rKE5GdFjlidgVZ6PBJ7lycvOXKKDW96E9zp1dpFrufmLE6eji11lKrxnr9BUdO2CvwWld1FV5Nw0lwE21tDVZaNM9ewQo5HbJF4L+Jv/OVl+1aR4UNuS0IhVc3w18wUqHAIkeZvaCJhPqS/cqAZFkc9cHsgwt0k4kS9Xpcn5P43lvLQL5aNs2OYcbvovszFqnI1RQ/8JImhldLYYYIA9aGvxPSD7rUeHB22VUi/bXvdoxKhhmNnKLGOVet5YfaIFfNF27LulLzMKJ1wnEMTGXWp9ZSdHoK3ntiljYQRgQWmH8+9WSGfTqWkEy4wGJxf1sqeVuWG+1EoRS6z3utJgeqHLITFj0lwhso=----ATTACHMENT:----NjExMTE1ODkxMDczMDgyMyA2MTk2OTM4NDk1ODE5NDkgODY3Mzk0MDg2NzY1OTQxNQ==