handle undefined global, fixes #1544

This commit is contained in:
El RIDO 2025-05-18 21:15:39 +02:00
parent 6347b6193e
commit c08a792f01
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
3 changed files with 13 additions and 5 deletions

View file

@ -185,7 +185,9 @@ class FilesystemTest extends TestCase
foreach (array('purge_limiter', 'salt', 'traffic_limiter') as $namespace) {
file_put_contents($this->_invalidPath . DIRECTORY_SEPARATOR . $namespace . '.php', 'invalid content');
$model = new Filesystem(array('dir' => $this->_invalidPath));
ob_start(); // hide "invalid content", when file gets included
$this->assertEquals($model->getValue($namespace), '', 'empty default value returned, invalid content ignored');
ob_end_clean();
$this->assertTrue($model->setValue(VALID, $namespace), 'setting valid value');
$this->assertEquals($model->getValue($namespace), VALID, 'valid value returned');
}