|
|
|
|
@ -96,8 +96,8 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
global $_islandora_derivative_test_ingest_method; |
|
|
|
|
$_islandora_derivative_test_ingest_method = 'ingestDatastream'; |
|
|
|
|
$object = $this->constructBaseObject(); |
|
|
|
|
$object = $this->constructDERIVDatastream($object); |
|
|
|
|
$this->constructNOSOURCEDatastream($object); |
|
|
|
|
$object = $this->constructDerivDatastream($object); |
|
|
|
|
$this->constructNoSourceDatastream($object); |
|
|
|
|
$islandora_object = islandora_object_load($this->pid); |
|
|
|
|
islandora_do_derivatives($islandora_object, array( |
|
|
|
|
'force' => TRUE, |
|
|
|
|
@ -128,7 +128,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
global $_islandora_derivative_test_ingest_method; |
|
|
|
|
$_islandora_derivative_test_ingest_method = 'ingestDatastream'; |
|
|
|
|
$object = $this->constructBaseObject(); |
|
|
|
|
$this->constructDERIVDatastream($object); |
|
|
|
|
$this->constructDerivDatastream($object); |
|
|
|
|
// Need to do this as Tuque caches. |
|
|
|
|
$connection = islandora_get_tuque_connection(); |
|
|
|
|
$connection->cache->resetCache(); |
|
|
|
|
@ -159,11 +159,11 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
/** |
|
|
|
|
* Tests derivative hook filtering based upon source_dsid. |
|
|
|
|
*/ |
|
|
|
|
public function testDerivativeFilteringOnSourceDSID() { |
|
|
|
|
public function testDerivativeFilteringOnSourceDsid() { |
|
|
|
|
global $_islandora_derivative_test_derivative_functions; |
|
|
|
|
$_islandora_derivative_test_derivative_functions = array(); |
|
|
|
|
$object = $this->constructBaseObject(); |
|
|
|
|
$this->constructSOMEWEIRDDATASTREAMDatastream($object); |
|
|
|
|
$this->constructSomeWeirdDatastream($object); |
|
|
|
|
$object = islandora_object_load($this->pid); |
|
|
|
|
islandora_do_derivatives($object, array( |
|
|
|
|
'source_dsid' => 'OBJ', |
|
|
|
|
@ -185,7 +185,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
/** |
|
|
|
|
* Tests that only functions were the source_dsid is NULL are fired. |
|
|
|
|
*/ |
|
|
|
|
public function testNULLSourceDSID() { |
|
|
|
|
public function testNullSourceDsid() { |
|
|
|
|
global $_islandora_derivative_test_derivative_functions; |
|
|
|
|
$_islandora_derivative_test_derivative_functions = array(); |
|
|
|
|
$this->constructBaseObject(); |
|
|
|
|
@ -212,7 +212,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
global $_islandora_derivative_test_derivative_functions; |
|
|
|
|
$_islandora_derivative_test_derivative_functions = array(); |
|
|
|
|
$object = $this->constructBaseObject(); |
|
|
|
|
$object = $this->constructSOMEWEIRDDATASTREAMDatastream($object); |
|
|
|
|
$object = $this->constructSomeWeirdDatastream($object); |
|
|
|
|
$object = islandora_object_load($this->pid); |
|
|
|
|
islandora_do_derivatives($object, array()); |
|
|
|
|
$this->assertDatastreams($object, array( |
|
|
|
|
@ -230,11 +230,11 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
/** |
|
|
|
|
* Tests that when no source_dsid all derivative functions are called. |
|
|
|
|
*/ |
|
|
|
|
public function testNoSourceDSIDForce() { |
|
|
|
|
public function testNoSourceDsidForce() { |
|
|
|
|
global $_islandora_derivative_test_derivative_functions; |
|
|
|
|
$_islandora_derivative_test_derivative_functions = array(); |
|
|
|
|
$object = $this->constructBaseObject(); |
|
|
|
|
$this->constructSOMEWEIRDDATASTREAMDatastream($object); |
|
|
|
|
$this->constructSomeWeirdDatastream($object); |
|
|
|
|
$object = islandora_object_load($this->pid); |
|
|
|
|
islandora_do_derivatives($object, array( |
|
|
|
|
'force' => TRUE, |
|
|
|
|
@ -293,7 +293,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
* @return AbstractObject |
|
|
|
|
* The modified AbstractObject. |
|
|
|
|
*/ |
|
|
|
|
public function constructDERIVDatastream(AbstractObject $object) { |
|
|
|
|
public function constructDerivDatastream(AbstractObject $object) { |
|
|
|
|
$dsid = 'DERIV'; |
|
|
|
|
$ds = $object->constructDatastream($dsid); |
|
|
|
|
$ds->label = 'Test'; |
|
|
|
|
@ -311,7 +311,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
* @return AbstractObject |
|
|
|
|
* The modified AbstractObject. |
|
|
|
|
*/ |
|
|
|
|
public function constructNOSOURCEDatastream(AbstractObject $object) { |
|
|
|
|
public function constructNoSourceDatastream(AbstractObject $object) { |
|
|
|
|
$dsid = 'NOSOURCE'; |
|
|
|
|
$ds = $object->constructDatastream($dsid); |
|
|
|
|
$ds->label = 'Test'; |
|
|
|
|
@ -329,7 +329,7 @@ class IslandoraDerivativesTestCase extends IslandoraWebTestCase {
|
|
|
|
|
* @return AbstractObject |
|
|
|
|
* The modified AbstractObject. |
|
|
|
|
*/ |
|
|
|
|
public function constructSOMEWEIRDDATASTREAMDatastream(AbstractObject $object) { |
|
|
|
|
public function constructSomeWeirdDatastream(AbstractObject $object) { |
|
|
|
|
$dsid = 'SOMEWEIRDDATASTREAM'; |
|
|
|
|
$ds = $object->constructDatastream($dsid); |
|
|
|
|
$ds->label = 'Test'; |
|
|
|
|
|