RomaricDrigon\MetaYaml\SchemaValidator::validate PHP Method

validate() public method

main function
public validate ( $schema_config, $data )
    public function validate($schema_config, $data)
    {
        $this->schema_config = $schema_config;
        if (isset($schema_config['prefix'])) {
            $this->prefix = $schema_config['prefix'];
        }
        return $this->validateNode('root', $schema_config['root'][$this->getFullName('type')], $schema_config['root'], $data);
    }

Usage Example

 public function testXmlBase()
 {
     $this->if($loader = new XmlLoader())->and($data = $loader->loadFromFile('test/data/TestXml/TestBase.xml'))->and($config = $loader->loadFromFile('test/data/TestXml/Schema.xml'))->and($object = new testedClass())->then->boolean($object->validate($config, $data))->isEqualTo(true);
 }
All Usage Examples Of RomaricDrigon\MetaYaml\SchemaValidator::validate