Skip to content

Commit 63dc2b0

Browse files
authored
Merge pull request #17 from onelazydev/io-warning-fix
Fixed XSD location in ErnParserController
2 parents 6e64cd4 + 794fa39 commit 63dc2b0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Controller/ErnParserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ private function validateXml(string $file_path) {
679679
$xml_reader = new XMLReader();
680680
$xml_reader->open($file_path);
681681

682-
$xsd_file_path = "xsd/release_notification/{$this->version}/release-notification.xsd";
682+
$xsd_file_path = __DIR__ . "/../../xsd/release_notification/{$this->version}/release-notification.xsd";
683683
$xml_reader->setSchema($xsd_file_path);
684684

685685
try {

tests/Controller/ParserControllerErrorsTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function testNotValidXsd() {
5959
$parser->parse("tests/samples/005_not_valid_xsd.xml");
6060
$this->assertFalse(true);
6161
} catch (XsdCompliantException $ex) {
62-
$expected_message = "This XML file tests/samples/005_not_valid_xsd.xml does not validates XSD xsd/release_notification/382/release-notification.xsd. Error: XMLReader::read(): Element 'FakeTag': This element is not expected. Expected is one of ( SoundRecordingType, IsArtistRelated, SoundRecordingId ).";
63-
$this->assertEquals($expected_message, $ex->getMessage());
62+
$this->assertStringContainsString('This XML file tests/samples/005_not_valid_xsd.xml does not validates XSD', $ex->getMessage());
63+
$this->assertStringContainsString("xsd/release_notification/382/release-notification.xsd. Error: XMLReader::read(): Element 'FakeTag': This element is not expected. Expected is one of ( SoundRecordingType, IsArtistRelated, SoundRecordingId ).", $ex->getMessage());
6464
}
6565

6666
// If setXsdValidation is not set, will raise another error later
@@ -72,5 +72,4 @@ public function testNotValidXsd() {
7272
$this->assertEquals($expected_message, $ex->getMessage());
7373
}
7474
}
75-
7675
}

0 commit comments

Comments
 (0)