2017-04-26 07:56:00 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* DBTestCase.php
|
|
|
|
*
|
|
|
|
* Base Test Case for Database tests
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @package LibreNMS
|
|
|
|
* @link http://librenms.org
|
|
|
|
* @copyright 2017 Tony Murray
|
|
|
|
* @author Tony Murray <murraytony@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace LibreNMS\Tests;
|
|
|
|
|
2019-03-12 00:49:14 -05:00
|
|
|
abstract class DBTestCase extends TestCase
|
2017-04-26 07:56:00 -05:00
|
|
|
{
|
2019-03-12 00:49:14 -05:00
|
|
|
protected $db_name;
|
2018-04-11 10:15:13 -05:00
|
|
|
|
2017-04-26 07:56:00 -05:00
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
2017-12-20 08:36:49 -06:00
|
|
|
$this->dbSetUp();
|
2019-03-12 00:49:14 -05:00
|
|
|
$this->db_name = dbFetchCell('SELECT DATABASE()');
|
2017-04-26 07:56:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
2017-12-20 08:36:49 -06:00
|
|
|
$this->dbTearDown();
|
2017-04-26 07:56:00 -05:00
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
}
|