mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-24 07:20:45 -04:00
replicate reported error
This commit is contained in:
parent
bace4695ac
commit
6347b6193e
1 changed files with 12 additions and 0 deletions
|
@ -178,4 +178,16 @@ class FilesystemTest extends TestCase
|
|||
$this->assertEquals($this->_model->readComments($dataid), array($comment['meta']['created'] => $comment), "comment of $dataid wasn't modified in the conversion");
|
||||
}
|
||||
}
|
||||
|
||||
public function testValueFileErrorHandling()
|
||||
{
|
||||
define('VALID', 'valid content');
|
||||
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));
|
||||
$this->assertEquals($model->getValue($namespace), '', 'empty default value returned, invalid content ignored');
|
||||
$this->assertTrue($model->setValue(VALID, $namespace), 'setting valid value');
|
||||
$this->assertEquals($model->getValue($namespace), VALID, 'valid value returned');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue