function FileStorageTest::testReadUnsupportedDataTypeConfigException
Test UnsupportedDataTypeConfigException displays path of erroneous file during read.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Config/ Storage/ FileStorageTest.php, line 79
Class
- FileStorageTest
- Tests FileStorage operations.
Namespace
Drupal\KernelTests\Core\Config\StorageCode
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.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.