ProtobufTest\SerializeMessageTest::testReadExtensionAnimalMessage PHP Method

testReadExtensionAnimalMessage() public method

    public function testReadExtensionAnimalMessage()
    {
        Extension\Extension::registerAllExtensions($this->config->getExtensionRegistry());
        $binary = $this->getProtoContent('extension-animal-cat.bin');
        $animal = Extension\Animal::fromStream($binary, $this->config);
        $this->assertInstanceOf(Extension\Animal::CLASS, $animal);
        $this->assertInstanceOf(Collection::CLASS, $animal->extensions());
        $this->assertEquals(Extension\Animal\Type::CAT(), $animal->getType());
        $extensions = $animal->extensions();
        $cat = $extensions->get(Extension\Cat::animal());
        $this->assertInstanceOf(Extension\Cat::CLASS, $cat);
        $this->assertTrue($cat->getDeclawed());
    }