Smalot\PdfParser\Tests\Units\Header::testResolveXRef PHP Method

testResolveXRef() public method

public testResolveXRef ( )
    public function testResolveXRef()
    {
        $document = new \Smalot\PdfParser\Document();
        $content = '<</Type/Page/SubType/Text/Font 5 0 R/Resources 8 0 R>>foo';
        $position = 0;
        $header = \Smalot\PdfParser\Header::parse($content, $document, $position);
        $object = new \Smalot\PdfParser\Page($document, $header);
        $document->setObjects(array('5_0' => $object));
        $this->assert->object($header->get('Font'))->isInstanceOf('\\Smalot\\PdfParser\\Object');
        $header = $header->get('Resources');
        try {
            $this->assert->variable($header)->isInstanceOf('\\Smalot\\PdfParser\\Element\\ElementMissing');
            $this->assert->boolean(true)->isEqualTo(false);
        } catch (\Exception $e) {
            $this->assert->variable($header)->isNull();
        }
    }