Skip to content

Commit

Permalink
#766 Removed unnecessary mock test class and moved remaining mock tes…
Browse files Browse the repository at this point in the history
…t class back to the support folder.
  • Loading branch information
haogatyp committed Oct 10, 2023
1 parent ec8f82d commit 59b25c3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 43 deletions.
1 change: 0 additions & 1 deletion tests/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, [
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'oai'. DIRECTORY_SEPARATOR . 'models',
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'support', // Support-Klassen fuer Tests
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'library', // tests/library
APPLICATION_PATH . DIRECTORY_SEPARATOR . 'library', // Server library
Expand Down
34 changes: 0 additions & 34 deletions tests/modules/oai/models/MockDefaultOaiServer.php

This file was deleted.

4 changes: 2 additions & 2 deletions tests/modules/oai/models/OaiConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function getTestConfiguration()
],
'format' => [
'default' => [
'class' => MockDefaultOaiServer::class,
'class' => Oai_Model_Prefix_Oai_OaiDcServer::class,
'viewHelpers' => 'optionValue, fileUrl, frontdoorUrl, transferUrl, dcmiType, dcType, openAireType',
'xsltFile' => 'oaiFile.xslt',
],
Expand Down Expand Up @@ -88,7 +88,7 @@ public function testGetDefaults()
'resumptionTokenPath' => '/vagrant/tests/workspace/tmp/resumption',
'emailContact' => '[email protected]',
'xsltFile' => 'oaiFile.xslt',
'class' => MockDefaultOaiServer::class,
'class' => Oai_Model_Prefix_Oai_OaiDcServer::class,
'viewHelpers' => 'optionValue, fileUrl, frontdoorUrl, transferUrl, dcmiType, dcType, openAireType',
];

Expand Down
11 changes: 5 additions & 6 deletions tests/modules/oai/models/ServerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ protected function getTestConfiguration()
],
'format' => [
'default' => [
'class' => MockDefaultOaiServer::class,
'class' => Oai_Model_Prefix_Oai_OaiDcServer::class,
'viewHelpers' => 'optionValue, fileUrl, frontdoorUrl, transferUrl, dcmiType, dcType, openAireType',
'xsltFile' => 'oaiFile.xslt',
'hasFilesVisibleInOai' => 1,
],
'copy_xml' => [
Expand Down Expand Up @@ -102,7 +101,7 @@ public function testCreate()
$serverFactory = new Oai_Model_ServerFactory();
$serverFactory->setOaiConfig($this->getOaiConfig());
$server = $serverFactory->create();
$this->assertEquals(MockDefaultOaiServer::class, get_class($server));
$this->assertEquals(Oai_Model_Prefix_Oai_OaiDcServer::class, get_class($server));
}

public function testCreateWithMetadataPrefix()
Expand All @@ -118,7 +117,7 @@ public function testCreateWithUnknownMetadataPrefix()
$serverFactory = new Oai_Model_ServerFactory();
$serverFactory->setOaiConfig($this->getOaiConfig());
$server = $serverFactory->create('unknownPrefix');
$this->assertEquals(MockDefaultOaiServer::class, get_class($server));
$this->assertEquals(Oai_Model_Prefix_Oai_OaiDcServer::class, get_class($server));
}

public function testCreateWithNoFormatConfiguration()
Expand Down Expand Up @@ -184,7 +183,7 @@ public function testDefaultServerOptionsWithDefaultConfiguration()
'maxListRecords' => 10,
'resumptionTokenPath' => '/vagrant/tests/workspace/tmp/resumption',
'emailContact' => '[email protected]',
'xsltFile' => 'oaiFile.xslt',
'xsltFile' => 'oai_dc.xslt',
'documentStatesAllowed' => ['published', 'deleted'],
'viewHelpers' => ['optionValue', 'fileUrl', 'frontdoorUrl', 'transferUrl', 'dcmiType', 'dcType', 'openAireType', 'listMetadataFormats'],
'notEmbargoedOn' => false,
Expand All @@ -194,7 +193,7 @@ public function testDefaultServerOptionsWithDefaultConfiguration()
'checkEmbargo' => false,
];

$this->assertEquals(MockDefaultOaiServer::class, get_class($server));
$this->assertEquals(Oai_Model_Prefix_Oai_OaiDcServer::class, get_class($server));
$this->assertEquals($expectedOptions, $server->getOptions(array_keys($expectedOptions)));
}

Expand Down
File renamed without changes.

0 comments on commit 59b25c3

Please sign in to comment.