Refactor tests (#10625)

* Refactor tests
Boot Laravel for all tests.
Config use private static property for storage instead of global

* Backup/restore modules

* disable snmpsim log

* Fixing DBTestCase

* Fix macros loading to the wrong place

* trap and other tests should check if db is available

* don't include snmp.inc.php if mock.snmp.inc.php is already included...

* fix migration

* if we don't reset the db, run migrations at least.

* set vars for migrate too

* Fix style

* ignore issues with undefined indexes in legacy code
This commit is contained in:
Tony Murray
2019-10-13 13:40:38 +00:00
committed by GitHub
parent 4cf584b425
commit 63442e8b4a
48 changed files with 298 additions and 324 deletions

View File

@@ -27,12 +27,15 @@ namespace LibreNMS\Tests\Feature\SnmpTraps;
use App\Models\Device;
use App\Models\Ipv4Address;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use LibreNMS\Snmptrap\Dispatcher;
use LibreNMS\Snmptrap\Trap;
use LibreNMS\Tests\LaravelTestCase;
use LibreNMS\Tests\DBTestCase;
class FgTrapIpsTest extends LaravelTestCase
class FgTrapIpsTest extends DBTestCase
{
use DatabaseTransactions;
public function testIpsAnomaly()
{
$device = factory(Device::class)->create();