public function testGetObjectLength() { $string = 'Hello World'; $object = new PrintableString($string); $expectedSize = 2 + strlen($string); $this->assertEquals($expectedSize, $object->getObjectLength()); }
public function testGetBinary() { $tag = 0x1; $string = new PrintableString('test'); $expectedType = chr(Identifier::create(Identifier::CLASS_CONTEXT_SPECIFIC, $isConstructed = true, $tag)); $expectedLength = chr($string->getObjectLength()); $encodedStringObject = $string->getBinary(); $object = new ExplicitlyTaggedObject($tag, $string); $this->assertBinaryEquals($expectedType . $expectedLength . $encodedStringObject, $object->getBinary()); }