mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-02-16 05:28:43 +00:00
fix create log
This commit is contained in:
parent
6f0017e9b0
commit
1731a285d2
|
|
@ -73,7 +73,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using empty string as the data is represented by the current model
|
// Using empty string as the data is represented by the current model
|
||||||
$newString = ''; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
$newString = null; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
||||||
$audit = new Audit(
|
$audit = new Audit(
|
||||||
new NullAccount($account),
|
new NullAccount($account),
|
||||||
null,
|
null,
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,10 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testLogCreate() : void
|
public function testLogCreate() : void
|
||||||
{
|
{
|
||||||
$this->module->eventLogCreate(1, null, ['id' => 1, 'test' => true], 1, 'test-trigger', 'Auditor', 'abc', 'def');
|
$this->module->eventLogCreate(1, null, ['id' => 1, 'test' => true], 1, 'test-trigger', 'Auditor', 'abc', 'def');
|
||||||
$logs = AuditMapper::getAll()->execute();
|
$logs = AuditMapper::getAll()
|
||||||
|
->sort('id', 'DESC')
|
||||||
|
->limit(100)
|
||||||
|
->execute();
|
||||||
|
|
||||||
foreach($logs as $log) {
|
foreach($logs as $log) {
|
||||||
if ($log->id > 0
|
if ($log->id > 0
|
||||||
|
|
@ -105,7 +108,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
&& $log->ref === 'abc'
|
&& $log->ref === 'abc'
|
||||||
&& \strlen($log->content) > 0
|
&& \strlen($log->content) > 0
|
||||||
&& $log->old === null
|
&& $log->old === null
|
||||||
&& \strlen($log->new) > 0
|
&& $log->new === null // null because the object itself is the data, no additional logging required
|
||||||
) {
|
) {
|
||||||
self::assertTrue(true);
|
self::assertTrue(true);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user