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

Correction validation OAI avec attribut mal formé

parent ae7a9f84
No related merge requests found
......@@ -54,7 +54,7 @@ class Class_Xml_Builder {
public function attributesToString($attributes) {
$attribs = '';
foreach ($attributes as $k => $v)
$attribs .= ' ' . $k . '="' . $v . '"';
$attribs .= ' ' . $k . '="' . htmlentities($v, ENT_COMPAT|ENT_XML1) . '"';
return $attribs;
}
......
......@@ -34,6 +34,8 @@ abstract class OAIControllerGetRecordTestCase extends AbstractControllerTestCase
}
class OAIControllerGetRecordNoIdentifierTest extends OAIControllerGetRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -57,6 +59,8 @@ class OAIControllerGetRecordNoIdentifierTest extends OAIControllerGetRecordTestC
}
class OAIControllerGetRecordNoMetadataPrefixTest extends OAIControllerGetRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -81,6 +85,7 @@ class OAIControllerGetRecordNoMetadataPrefixTest extends OAIControllerGetRecordT
class OAIControllerGetRecordNotFoundParamsTest extends OAIControllerGetRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -90,7 +95,7 @@ class OAIControllerGetRecordNotFoundParamsTest extends OAIControllerGetRecordTes
->with('harrypotter-sorciers')
->answers(null);
$this->dispatch('/opac/oai/request?verb=GetRecord&metadataPrefix=oai_dc&identifier=harrypotter-sorciers', true);
$this->dispatch('/opac/oai/request?verb=GetRecord&metadataPrefix=oai_dc&identifier=harrypotter-sorciers\"id', true);
$this->_xml = $this->_response->getBody();
}
......@@ -98,7 +103,7 @@ class OAIControllerGetRecordNotFoundParamsTest extends OAIControllerGetRecordTes
/** @test */
public function requestVerbShouldBeGetRecord() {
$this->_xpath->assertXpath($this->_xml,
'//oai:request[@verb="GetRecord"][@identifier="harrypotter-sorciers"][@metadataPrefix="oai_dc"]');
'//oai:request[@verb="GetRecord"][contains(@identifier, "harrypotter-sorciers")][@metadataPrefix="oai_dc"]');
}
......@@ -110,6 +115,8 @@ class OAIControllerGetRecordNotFoundParamsTest extends OAIControllerGetRecordTes
}
class OAIControllerGetRecordNotSupportedPrefixTest extends OAIControllerGetRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -143,6 +150,8 @@ class OAIControllerGetRecordNotSupportedPrefixTest extends OAIControllerGetRecor
}
class OAIControllerGetRecordValidParamsTest extends OAIControllerGetRecordTestCase {
public function setUp() {
parent::setUp();
......@@ -212,5 +221,4 @@ class OAIControllerGetRecordValidParamsTest extends OAIControllerGetRecordTestCa
self::OAI_RECORD_PATH . 'oai:metadata',
1);
}
}
\ No newline at end of file
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