mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Mock astext (#14581)
* Mock astext avoid dns failures * whitespace * fix arista * restore test data except astext * restore test data except astext * Full fresh run * Move DI call into class
This commit is contained in:
@@ -530,6 +530,17 @@ class ModuleTestHelper
|
||||
Config::set('rrd.enable', false); // disable rrd
|
||||
Config::set('rrdtool_version', '1.7.2'); // don't detect rrdtool version, rrdtool is not install on ci
|
||||
|
||||
// don't allow external DNS queries that could fail
|
||||
app()->bind(\LibreNMS\Util\AutonomousSystem::class, function ($app, $parameters) {
|
||||
$asn = $parameters['asn'];
|
||||
$mock = \Mockery::mock(\LibreNMS\Util\AutonomousSystem::class);
|
||||
$mock->shouldReceive('name')->withAnyArgs()->zeroOrMoreTimes()->andReturnUsing(function () use ($asn) {
|
||||
return "AS$asn-MOCK-TEXT";
|
||||
});
|
||||
|
||||
return $mock;
|
||||
});
|
||||
|
||||
if (! is_file($this->snmprec_file)) {
|
||||
throw new FileNotFoundException("$this->snmprec_file does not exist!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user