public function testGetObjectLength() { $object = new Boolean(true); $this->assertEquals(3, $object->getObjectLength()); $object = new Boolean(false); $this->assertEquals(3, $object->getObjectLength()); }
public function testFromBinaryWithMultipleObjects() { $object1 = new Boolean(true); $object2 = new Integer(42); $identifier = 0xa0; $length = $object1->getObjectLength() + $object2->getObjectLength(); $data = chr($identifier) . chr($length) . $object1->getBinary() . $object2->getBinary(); $object = ExplicitlyTaggedObject::fromBinary($data); $this->assertEquals(2 + $length, $object->getObjectLength()); $this->assertEquals([$object1, $object2], $object->getContent()); $this->assertEquals($data, $object->getBinary()); $this->assertEquals('2 context specific objects with tag [0]', $object->__toString()); }