mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-01-11 04:58:40 +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
|
||||
$newString = ''; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
||||
$newString = null; //StringUtils::stringify($new, \JSON_PRETTY_PRINT);
|
||||
$audit = new Audit(
|
||||
new NullAccount($account),
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,10 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
public function testLogCreate() : void
|
||||
{
|
||||
$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) {
|
||||
if ($log->id > 0
|
||||
|
|
@ -105,7 +108,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
&& $log->ref === 'abc'
|
||||
&& \strlen($log->content) > 0
|
||||
&& $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);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user