* The Tuque class built from various supporting classes.
*/
class IslandoraTuque {
class IslandoraTuque {
/**
/**
* Connection to the repository
* Connection to the repository.
*
*
* @var RepositoryConnection
* @var RepositoryConnection
*/
*/
public $connection = NULL;
public $connection = NULL;
/**
/**
* The Fedora API we are using
* The Fedora API we are using.
*
*
* @var FedoraAPI
* @var FedoraAPI
*/
*/
@ -61,7 +63,7 @@ class IslandoraTuque {
/**
/**
* Constructor.
* Constructor.
*
*
* @param array $user
* @param object $user
* A Drupal user.
* A Drupal user.
* @param string $url
* @param string $url
* The url to the fedora instance.
* The url to the fedora instance.
@ -113,4 +115,5 @@ class IslandoraTuque {
$message = t('Islandora requires the !tuque_url. Please install in /sites/all/libraries/tuque before continuing. See the !islandora_url.', array('!tuque_url' => $tuque_link, '!islandora_url' => $islandora_doc_link));
$message = t('Islandora requires the !tuque_url. Please install in /sites/all/libraries/tuque before continuing. See the !islandora_url.', array('!tuque_url' => $tuque_link, '!islandora_url' => $islandora_doc_link));
* To make sense of these tests reference islandora_hooks_test.module.
* To make sense of these tests reference islandora_hooks_test.module.
*/
*/
/**
* Islandora hooks tests.
*/
class IslandoraHooksTestCase extends IslandoraWebTestCase {
class IslandoraHooksTestCase extends IslandoraWebTestCase {
/**
/**
@ -256,4 +259,5 @@ class IslandoraHooksTestCase extends IslandoraWebTestCase {
$this->assert($_SESSION['islandora_hooks']['hook'][ISLANDORA_DATASTREAM_INGESTED_HOOK], 'Called ISLANDORA_DATASTREAM_INGESTED_HOOK when ingesting via FedoraObject::ingestDatastream.');
$this->assert($_SESSION['islandora_hooks']['hook'][ISLANDORA_DATASTREAM_INGESTED_HOOK], 'Called ISLANDORA_DATASTREAM_INGESTED_HOOK when ingesting via FedoraObject::ingestDatastream.');
$pass = "Datastream {$this->datastream} contains the appropriate JP2 ending marker.";
$pass = "Datastream {$this->datastream} contains the appropriate JP2 ending marker.";
$fail = "Datastream {$this->datastream} does not contain the appropriate JP2 ending marker. If this is the only JP2 validator that failed, it is likely that derivative generation was interrupted.";
$fail = "Datastream {$this->datastream} does not contain the appropriate JP2 ending marker. If this is the only JP2 validator that failed, it is likely that derivative generation was interrupted.";
$message = $assertion ? $pass : $fail;
$message = $assertion ? $pass : $fail;
$this->addResult($assertion, $message);
$this->addResult($assertion, $message);
}
}
}
}
/**
/**
@ -296,7 +298,7 @@ class PDFDatastreamValidator extends DatastreamValidator {
$pass = "{$this->datastream} datastream reports the existence of {$pdf_stream_count} PDF streams. Note that an extremely low number could still indicate corruption.";
$pass = "{$this->datastream} datastream reports the existence of {$pdf_stream_count} PDF streams. Note that an extremely low number could still indicate corruption.";
@ -319,17 +321,15 @@ class PDFDatastreamValidator extends DatastreamValidator {
$pass = "{$this->datastream} datastream reports the existence of the closing 'EOF' tag required at the end of PDFs";
$pass = "{$this->datastream} datastream reports the existence of the closing 'EOF' tag required at the end of PDFs";
$fail = "{$this->datastream} datastream does not contain the closing 'EOF' tag. If this is the only PDF validation that failed, it is likely that derivative generation was interrupted.";
$fail = "{$this->datastream} datastream does not contain the closing 'EOF' tag. If this is the only PDF validation that failed, it is likely that derivative generation was interrupted.";
$message = $assertion ? $pass : $fail;
$message = $assertion ? $pass : $fail;
$this->addResult($assertion, $message);
$this->addResult($assertion, $message);
}
}
}
}
/**
/**
@ -340,6 +340,7 @@ class PDFDatastreamValidator extends DatastreamValidator {
* integer representing the number of times it should appear in the datastream.
* integer representing the number of times it should appear in the datastream.
*/
*/
class TextDatastreamValidator extends DatastreamValidator {
class TextDatastreamValidator extends DatastreamValidator {
/**
/**
* Constructor override; blow up if we don't have our two values.
* Constructor override; blow up if we don't have our two values.
*/
*/
@ -369,6 +370,7 @@ class TextDatastreamValidator extends DatastreamValidator {