o one syslog unwrapped
o testsuite return class path missing
This commit is contained in:
Ad Schellevis 2021-04-18 17:04:34 +02:00
parent e70427d9de
commit 001325988c
2 changed files with 8 additions and 5 deletions

View File

@ -31,6 +31,7 @@ namespace OPNsense\Base;
use Exception;
use OPNsense\Base\FieldTypes\ContainerField;
use OPNsense\Core\Config;
use Phalcon\Logger;
use Phalcon\Logger\Adapter\Syslog;
use Phalcon\Validation;
use Phalcon\Messages\Messages;
@ -553,10 +554,12 @@ abstract class BaseModel
public function serializeToConfig($validateFullModel = false, $disable_validation = false)
{
// create logger to save possible consistency issues to
$logger = new Syslog("config", array(
'option' => LOG_PID,
'facility' => LOG_LOCAL2
));
$logger = new Logger(
'messages',
[
'main' => new Syslog("config", ['option' => LOG_PID, 'facility' => LOG_LOCAL2])
]
);
// Perform validation, collect all messages and raise exception if validation is not disabled.
// If for some reason the developer chooses to ignore the errors, let's at least log there something

View File

@ -99,7 +99,7 @@ class ModelRelationFieldTest extends Field_Framework_TestCase
));
$field->eventPostLoading();
$field->setValue("XX5ea2a35c-b02b-485a-912b-d077e639bf9f");
$this->assertEquals($this->validate($field), ['InclusionIn']);
$this->assertEquals($this->validate($field), ['Phalcon\Validation\Validator\InclusionIn']);
}
public function testSetMultiOk()