fixing support for pre renaming configuration file format, resolves #37

This commit is contained in:
El RIDO
2016-07-13 09:41:45 +02:00
parent 8f2d43722b
commit 4d10fd9690
5 changed files with 85 additions and 12 deletions

View File

@@ -139,6 +139,50 @@ class privatebin_dbTest extends PHPUnit_Framework_TestCase
));
}
/**
* @expectedException Exception
* @expectedExceptionCode 6
*/
public function testMissingDsn()
{
$options = $this->_options;
unset($options['dsn']);
privatebin_db::getInstance($options);
}
/**
* @expectedException Exception
* @expectedExceptionCode 6
*/
public function testMissingUsr()
{
$options = $this->_options;
unset($options['usr']);
privatebin_db::getInstance($options);
}
/**
* @expectedException Exception
* @expectedExceptionCode 6
*/
public function testMissingPwd()
{
$options = $this->_options;
unset($options['pwd']);
privatebin_db::getInstance($options);
}
/**
* @expectedException Exception
* @expectedExceptionCode 6
*/
public function testMissingOpt()
{
$options = $this->_options;
unset($options['opt']);
privatebin_db::getInstance($options);
}
public function testTableUpgrade()
{
$path = PATH . 'data/db-test.sq3';