Skip to content
Snippets Groups Projects
Commit 08e22908 authored by catch's avatar catch
Browse files

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

parent 9e8c0511
No related branches found
No related tags found
No related merge requests found
......@@ -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,17 +73,15 @@ public function testlistAll() {
}
/**
* Test UnsupportedDataTypeConfigException displays path of
* erroneous file during read.
* Tests UnsupportedDataTypeConfigException.
*/
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.');
}
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);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment