OSPF port module (#13498)

* OSPF to module

* Update mock

* lint and style fixes

* enums as strings
This commit is contained in:
Tony Murray
2021-11-12 13:49:09 -06:00
committed by GitHub
parent 666638eeaa
commit 0adf37b4e1
7 changed files with 323 additions and 209 deletions

View File

@@ -58,6 +58,10 @@ class SnmpQueryMock implements SnmpQueryInterface
* @var bool
*/
private $numeric = false;
/**
* @var bool
*/
private $hideMib = false;
/**
* @var array|mixed
*/
@@ -99,6 +103,9 @@ class SnmpQueryMock implements SnmpQueryInterface
if ($this->numeric) {
$options[] = '-On';
}
if ($this->hideMib) {
$options[] = '-Os';
}
return NetSnmpQuery::make()
->mibDir($this->mibDir)
@@ -118,6 +125,21 @@ class SnmpQueryMock implements SnmpQueryInterface
return $this;
}
public function hideMib(): SnmpQueryInterface
{
$this->hideMib = true;
return $this;
}
public function enumStrings(): SnmpQueryInterface
{
// TODO: Implement enumStrings() method, no idea how
Log::error('enumStrings not implemented in SnmpQueryMock');
return $this;
}
public function options($options = []): SnmpQueryInterface
{
$this->options = $options;