@ -16,9 +16,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
}
}
function setUp() {
function setUp() {
parent::setUp('tabs', 'fe dora_repository');
parent::setUp('tabs', 'islan dora_repository');
module_load_include('inc', 'fe dora_repository', 'api/fedora_item');
module_load_include('inc', 'islan dora_repository', 'api/fedora_item');
// Create and login user.
// Create and login user.
$repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams',
$repository_user = $this->drupalCreateFedoraUser(array('add fedora datastreams',
@ -57,11 +57,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fe dora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islan dora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message');
$this->assertText('mimetype (application/pdf) is not associated with this Content Model', 'PDF mime type not accepted in collection content model.', 'message');
$this->outputScreenContents('Initial ingest form submit step 2', 'fe dora_repository');
$this->outputScreenContents('Initial ingest form submit step 2', 'islan dora_repository');
// Now try ingesting a proper collection policy.
// Now try ingesting a proper collection policy.
$ingest_form = array();
$ingest_form = array();
@ -72,9 +72,9 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array();
$ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:title'] = $this->randomName(32);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fe dora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islan dora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
//$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'fe dora_repository');
//$this->outputScreenContents('Initial ingest form submit step 2 - PDF collection', 'islan dora_repository');
$this->assertPattern('/Item .* created successfully./', "Verified item created.");
$this->assertPattern('/Item .* created successfully./', "Verified item created.");
$pid = $this->getIngestedPid();
$pid = $this->getIngestedPid();
@ -88,7 +88,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$ingest_form_step_2 = array();
$ingest_form_step_2 = array();
$ingest_form_step_2['dc:title'] = "Lorem Ipsum";
$ingest_form_step_2['dc:title'] = "Lorem Ipsum";
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['dc:description'] = $this->randomName(256);
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fe dora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'islan dora_repository') . '/tests/test_files/lorem_ipsum.pdf');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$this->drupalPost(NULL, $ingest_form_step_2, 'Ingest');
$pid = $this->getIngestedPid();
$pid = $this->getIngestedPid();
$pid_list[] = $pid;
$pid_list[] = $pid;
@ -104,7 +104,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection'));
$admin_tester = $this->drupalCreateUser(array('administer site configuration', 'view fedora collection'));
$this->drupalLogin($admin_tester);
$this->drupalLogin($admin_tester);
$pageContent = $this->drupalGet('admin/settings/fe dora_repository');
$pageContent = $this->drupalGet('admin/settings/islan dora_repository');
$hasOption = preg_match('/Enforce namespace restrictions/', $pageContent);
$hasOption = preg_match('/Enforce namespace restrictions/', $pageContent);
@ -115,13 +115,13 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
$this->pass('Removal of namespace restrictions is enabled');
$this->pass('Removal of namespace restrictions is enabled');
$inVal['fedora_namespace_restriction_enforced'] = TRUE;
$inVal['fedora_namespace_restriction_enforced'] = TRUE;
$inVal['fedora_pids_allowed'] = 'simpletest:';
$inVal['fedora_pids_allowed'] = 'simpletest:';
$this->drupalPost('admin/settings/fe dora_repository', $inVal, 'Save configuration');
$this->drupalPost('admin/settings/islan dora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalGet('fedora/repository/islandora:largeimages/');
$this->drupalGet('fedora/repository/islandora:largeimages/');
$this->assertPattern('/Access denied/', 'No access to Large image Collection Collection');
$this->assertPattern('/Access denied/', 'No access to Large image Collection Collection');
$inVal['fedora_namespace_restriction_enforced'] = 0;
$inVal['fedora_namespace_restriction_enforced'] = 0;
$this->drupalPost('admin/settings/fe dora_repository', $inVal, 'Save configuration');
$this->drupalPost('admin/settings/islan dora_repository', $inVal, 'Save configuration');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->assertPattern('/The configuration options have been saved./', 'The configuration options have been saved.');
$this->drupalLogin($this->repository_user);
$this->drupalLogin($this->repository_user);
$this->drupalGet('fedora/repository/islandora:largeimages/');
$this->drupalGet('fedora/repository/islandora:largeimages/');