mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: rewrite is_valid_port() (#7360)
* refactor: speed up is_valid_port() Convert is_valid_port to Config Several Config optimizations Update documentation * fix getCombined() when os key is not set, but global is. Add more tests
This commit is contained in:
committed by
Neil Lathwood
parent
777eb1f823
commit
6ea6218f47
@@ -97,6 +97,12 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||
$config['os']['nullos']['num'] = array('two', 'three');
|
||||
$config['assoc'] = array('a' => 'same', 'b' => 'same');
|
||||
$config['os']['nullos']['assoc'] = array('b' => 'different', 'c' => 'still same');
|
||||
$config['os']['nullos']['osset'] = true;
|
||||
$config['gset'] = true;
|
||||
|
||||
$this->assertTrue(Config::getCombined('nullos', 'non-existent', true), 'Did not return default value on non-existent key');
|
||||
$this->assertTrue(Config::getCombined('nullos', 'osset', false), 'Did not return OS value when global value is not set');
|
||||
$this->assertTrue(Config::getCombined('nullos', 'gset', false), 'Did not return global value when OS value is not set');
|
||||
|
||||
$combined = Config::getCombined('nullos', 'num');
|
||||
sort($combined);
|
||||
|
||||
Reference in New Issue
Block a user