diff --git a/library/Class/WebService/OAI/Request/ListIdentifiers.php b/library/Class/WebService/OAI/Request/ListIdentifiers.php index c67547f8568c8dda144a6a7f2c4357e89d58895b..fdcae99ca9514462706f6ef06a5d1379ceed5e9e 100644 --- a/library/Class/WebService/OAI/Request/ListIdentifiers.php +++ b/library/Class/WebService/OAI/Request/ListIdentifiers.php @@ -68,9 +68,6 @@ class Class_WebService_OAI_Request_ListIdentifiers { if ('oai_dc' != $this->_metadataPrefix) return $builder->error(array('code' => 'cannotDisseminateFormat')); - if (!$this->_set) - return $builder->error(array('code' => 'noRecordsMatch')); - if ($this->_set && !$this->_catalogue) return $builder->error(array('code' => 'badArgument'), 'Set not found'); diff --git a/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php b/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php index a2b2492d3df2a2ba507b83c5aac04c04c08a2231..4d6804ef4adda59e0f318fb1a823e579f80c2a54 100644 --- a/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php +++ b/tests/application/modules/opac/controllers/OAIControllerListRecordsTest.php @@ -99,23 +99,4 @@ class OAIControllerListRecordsInZorkSetTest extends AbstractControllerTestCase { } } - -class OAIControllerListRecordsWithoutSetTest extends AbstractControllerTestCase { - protected $_xpath; - protected $_xml; - - public function setUp() { - parent::setUp(); - $this->_xpath = TestXPathFactory::newOaiDc(); - $this->dispatch('/opac/oai/request?verb=ListRecords&metadataPrefix=oai_dc'); - $this->_xml = $this->_response->getBody(); - } - - - /** @test */ - public function shouldHaveNoRecordsError() { - $this->_xpath->assertXPath($this->_xml, '//oai:error[@code="noRecordsMatch"]'); - } -} - ?> \ No newline at end of file diff --git a/tests/application/modules/opac/controllers/OAIControllerTest.php b/tests/application/modules/opac/controllers/OAIControllerTest.php index 0b14ae42e930b7904d3a6ddebe435d4a04fa4d27..d8e124c54f33aa9431d9e324c2ea6e10f423d80d 100644 --- a/tests/application/modules/opac/controllers/OAIControllerTest.php +++ b/tests/application/modules/opac/controllers/OAIControllerTest.php @@ -57,19 +57,38 @@ abstract class OAIControllerRequestTestCase extends AbstractControllerTestCase { class OAIControllerIndentifyRequestTest extends OaiControllerRequestTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/opac/oai/request?verb=Identify', true); + } + + /** @test */ - public function shouldReturnIdentifyResponseWithoutError() { - $this->dispatch('/opac/oai/request?verb=Identify', true); + public function shouldReturnIdentifyResponse() { $this->_xpath->assertXPath($this->_response->getBody(), '//oai:request[@verb="Identify"]'); + } + + + /** @test */ + public function responseShouldNotHaveError() { $this->_xpath->assertNotXPath($this->_response->getBody(), '//oai:error'); } +} + + + + +class OAIControllerIndentifyRequestWithIllegalParameterTest extends OaiControllerRequestTestCase { + public function setUp() { + parent::setUp(); + $this->dispatch('/opac/oai/request?verb=Identify&test=test', true); + } /** @test */ public function shouldReturnErrorBadArgumentWithIllegalParameter() { - $this->dispatch('/opac/oai/request?verb=Identify&test=test', true); $this->_xpath->assertXPath($this->_response->getBody(), '//oai:error[@code="badArgument"]'); }