Esempio n. 1
0
 /**
  * @covers \Erebot\DOM
  */
 public function testValidationFailure()
 {
     $dom = new \Erebot\DOM();
     $this->assertTrue($dom->load(__DIR__ . DIRECTORY_SEPARATOR . 'nok.xml'));
     $this->assertFalse($dom->schemaValidate(__DIR__ . DIRECTORY_SEPARATOR . 'test.xsd'));
     $errors = $dom->getErrors();
     $this->assertSame(1, count($errors));
     // Inspect the error's contents.
     $this->assertSame(LIBXML_ERR_ERROR, $errors[0]->level);
     $this->assertSame('Wrong answer to life, the universe and everything', $errors[0]->message);
     $this->assertSame(__DIR__ . DIRECTORY_SEPARATOR . 'nok.xml', $errors[0]->file);
     $this->assertSame(2, $errors[0]->line);
     $this->assertSame('/Root', $errors[0]->path);
 }