validate() public method

public validate ( array $data )
$data array
コード例 #1
0
 public function testValidate()
 {
     $fileContent = file_get_contents(__DIR__ . '/../crud.yml');
     $validDefinition = Yaml::parse($fileContent);
     $validator = new EntityDefinitionValidator();
     $validator->validate($validDefinition);
     try {
         $validator->validate(['foo' => 'bar']);
         $this->fail();
     } catch (\LogicException $e) {
         // Expected
     } catch (\Exception $e) {
         $this->fail();
     }
 }