Skip to content
Snippets Groups Projects
Commit 0b0875d6 authored by llaffont's avatar llaffont
Browse files

Correction erreurs OAI conformité http://re.cs.uct.ac.za

parent c0522426
No related merge requests found
......@@ -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');
......
......@@ -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
......@@ -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"]');
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment