Files
librenms-librenms/tests/LaravelTestCase.php
T

30 lines
694 B
PHP
Raw Normal View History

2018-05-09 08:05:17 -05:00
<?php
2018-08-11 23:37:45 +02:00
namespace LibreNMS\Tests;
2018-05-09 08:05:17 -05:00
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
2018-08-11 23:37:45 +02:00
abstract class LaravelTestCase extends BaseTestCase
2018-05-09 08:05:17 -05:00
{
use CreatesApplication;
use SnmpsimHelpers;
2019-03-12 23:59:03 -05:00
public function dbSetUp()
{
if (getenv('DBTEST')) {
\LibreNMS\DB\Eloquent::boot();
\LibreNMS\DB\Eloquent::setStrictMode();
\LibreNMS\DB\Eloquent::DB()->beginTransaction();
} else {
$this->markTestSkipped('Database tests not enabled. Set DBTEST=1 to enable.');
}
}
public function dbTearDown()
{
if (getenv('DBTEST')) {
\LibreNMS\DB\Eloquent::DB()->rollBack();
}
}
2018-05-09 08:05:17 -05:00
}