|
|
@ -14,6 +14,11 @@ class IslandoraWebTestCase extends DrupalWebTestCase { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected $users = array(); |
|
|
|
protected $users = array(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* By default, deleteUserCreatedObjects() runs on each tearDown() step. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
protected $delete_objects_on_teardown = TRUE; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Sets up the Drupal filter to access this test Drupal instances database. |
|
|
|
* Sets up the Drupal filter to access this test Drupal instances database. |
|
|
|
* |
|
|
|
* |
|
|
@ -160,12 +165,18 @@ class IslandoraWebTestCase extends DrupalWebTestCase { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Restores the original Drupal filter, frees any allocated resources. |
|
|
|
* Restores the original Drupal filter, frees any allocated resources. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* To safeguard against leaving test objects in the repository, tearDown() |
|
|
|
|
|
|
|
* calls deleteUserCreatedObjects() every time by default. This feature can be |
|
|
|
|
|
|
|
* toggled by setting $this->delete_objects_on_teardown to TRUE or FALSE. |
|
|
|
|
|
|
|
* |
|
|
|
* @see DrupalWebTestCase::tearDown() |
|
|
|
* @see DrupalWebTestCase::tearDown() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function tearDown() { |
|
|
|
public function tearDown() { |
|
|
|
|
|
|
|
if ($this->delete_objects_on_teardown) { |
|
|
|
foreach ($this->users as $user) { |
|
|
|
foreach ($this->users as $user) { |
|
|
|
$this->deleteUserCreatedObjects($user); |
|
|
|
$this->deleteUserCreatedObjects($user); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if ($this->configuration['use_drupal_filter']) { |
|
|
|
if ($this->configuration['use_drupal_filter']) { |
|
|
|
$this->restoreDrupalFilter(); |
|
|
|
$this->restoreDrupalFilter(); |
|
|
|
} |
|
|
|
} |
|
|
@ -397,6 +408,10 @@ class IslandoraWebTestCase extends DrupalWebTestCase { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Deletes all objects created by the given user. |
|
|
|
* Deletes all objects created by the given user. |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* To safeguard against leaving test objects in the repository, this is called |
|
|
|
|
|
|
|
* each time DrupalTestCase::run() calls tearDown(). This feature can be |
|
|
|
|
|
|
|
* toggled by setting $this->delete_objects_on_teardown to TRUE or FALSE. |
|
|
|
|
|
|
|
* |
|
|
|
* @param object $username |
|
|
|
* @param object $username |
|
|
|
* The user whose objects we'd like to remove. |
|
|
|
* The user whose objects we'd like to remove. |
|
|
|
* |
|
|
|
* |
|
|
|