Exemple #1
0
 public function testBagIt_validateExistsFail()
 {
     $errors = array();
     $this->assertFalse(BagIt_validateExists(__DIR__ . '/not-here', $errors));
     $this->assertEquals(1, count($errors));
     $this->assertEquals('not-here', $errors[0][0]);
     $this->assertEquals('not-here does not exist.', $errors[0][1]);
 }
Exemple #2
0
 /**
  * Runs the bag validator on the contents of the bag. This verifies the
  * presence of required iles and folders and verifies the checksum for
  * each file.
  *
  * For the results of validation, check isValid() and getBagErrors().
  *
  * @return array The list of bag errors.
  */
 function validate()
 {
     $errors = array();
     BagIt_validateExists($this->bagitFile, $errors);
     BagIt_validateExists($this->getDataDirectory(), $errors);
     $this->manifest->validate($errors);
     $this->bagErrors = $errors;
     return $this->bagErrors;
 }