GrumPHP\Linter\Xml\XmlLinter::isInstalled PHP Method

isInstalled() public method

public isInstalled ( ) : boolean
return boolean
    public function isInstalled()
    {
        $extensions = get_loaded_extensions();
        return in_array('libxml', $extensions) && in_array('dom', $extensions);
    }

Usage Example

Example #1
0
 function it_throws_exception_if_the_process_fails(XmlLinter $linter, ContextInterface $context)
 {
     $linter->isInstalled()->willReturn(true);
     $linter->setLoadFromNet(false)->shouldBeCalled();
     $linter->setXInclude(false)->shouldBeCalled();
     $linter->setDtdValidation(false)->shouldBeCalled();
     $linter->setSchemeValidation(false)->shouldBeCalled();
     $linter->lint(Argument::type('SplFileInfo'))->willReturn(new LintErrorsCollection(array(new XmlLintError(LintError::TYPE_ERROR, 0, 'error', 'file.xml', 1, 1))));
     $context->getFiles()->willReturn(new FilesCollection(array(new SplFileInfo('file.xml', '.', 'file.xml'))));
     $this->shouldThrow('GrumPHP\\Exception\\RuntimeException')->duringRun($context);
 }
All Usage Examples Of GrumPHP\Linter\Xml\XmlLinter::isInstalled