Unverified Commit a3e497b7 authored by alexpott's avatar alexpott

Revert "Issue #3181272 by jungle, longwave, Balu Ertl, larowlan: Fix typo in...

Revert "Issue #3181272 by jungle, longwave, Balu Ertl, larowlan: Fix typo in FileStorage error message"

This reverts commit 4839e850.
parent be69c007
......@@ -115,7 +115,7 @@ public function read($name) {
$data = $this->decode($data);
}
catch (InvalidDataTypeException $e) {
throw new UnsupportedDataTypeConfigException('Invalid data type in config ' . $name . ', found in file ' . $filepath . ': ' . $e->getMessage());
throw new UnsupportedDataTypeConfigException('Invalid data type in config ' . $name . ', found in file' . $filepath . ' : ' . $e->getMessage());
}
$this->fileCache->set($filepath, $data);
......
......@@ -73,15 +73,17 @@ public function testlistAll() {
}
/**
* Tests UnsupportedDataTypeConfigException.
* Test UnsupportedDataTypeConfigException displays path of
* erroneous file during read.
*/
public function testUnsupportedDataTypeConfigException() {
$name = 'core.extension';
$path = $this->storage->getFilePath($name);
$this->expectException(UnsupportedDataTypeConfigException::class);
$this->expectExceptionMessageMatches("@Invalid data type in config $name, found in file $path: @");
file_put_contents($path, PHP_EOL . 'foo : @bar', FILE_APPEND);
$this->storage->read($name);
public function testReadUnsupportedDataTypeConfigException() {
file_put_contents($this->storage->getFilePath('core.extension'), PHP_EOL . 'foo : [bar}', FILE_APPEND);
try {
$config_parsed = $this->storage->read('core.extension');
}
catch (UnsupportedDataTypeConfigException $e) {
$this->assertStringContainsString($this->storage->getFilePath('core.extension'), $e->getMessage(), 'Erroneous file path is displayed.');
}
}
}
Markdown is supported
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