Наследование: extends Loader
Пример #1
0
 public function validateSchema()
 {
     $meta_schema_validator = new SchemaValidator();
     $json_loader = new JsonLoader();
     // we have to check if we use a prefix
     $meta_json = file_get_contents(__DIR__ . '/../../../data/MetaSchema.json');
     $meta_json = str_replace('#', $this->prefix, $meta_json);
     // we validate the schema using the meta schema, defining the structure of our schema
     $meta_schema_validator->validate($json_loader->load($meta_json), $this->schema);
     return true;
 }
Пример #2
0
 public function testBase()
 {
     $this->if($object = new testedClass())->then->object($object)->isInstanceOf('RomaricDrigon\\MetaYaml\\Loader\\JsonLoader')->array($object->loadFromFile('test/data/TestBasic/TestBase.json'))->isEqualTo(array('fleurs' => array('rose' => 'une rose', 'violette' => 'une violette')));
 }