Skip to content

Commit 9008b8a

Browse files
committed
feat(ZMSKVR-319): unittest
1 parent 7b9b7f3 commit 9008b8a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

zmsdb/src/Zmsdb/Notification.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ public function readResolvedReferences(\BO\Zmsentities\Schema\Entity $notificati
5656
new Helper\NoAuth(),
5757
$resolveReferences - 1
5858
);
59-
// only overwrite process with resolved version if not dereferenced
60-
if ($process && $notification->getScopeId() == $process->getScopeId()) {
61-
$notification->process = $process;
62-
}
63-
$notification->department = (new \BO\Zmsdb\Department())
64-
->readEntity($notification->department['id'], $resolveReferences - 1);
59+
60+
if ($process instanceof \BO\Zmsentities\Process && $process->hasId()) {
61+
$notification->process = $process;
62+
}
63+
64+
if ($notification->toProperty()->department->id->isAvailable()) {
65+
$notification->department = (new \BO\Zmsdb\Department())
66+
->readEntity($notification->department['id'], $resolveReferences - 1);
67+
}
6568
}
6669
return $notification;
6770
}

zmsdb/tests/Zmsdb/NotificationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public function testBasic()
1111
{
1212
$now = static::$now;
1313
$input = $this->getTestEntity();
14-
$input->process['status'] = 'pickup';
1514

1615
$this->assertEquals('0', $input->getFirstClient()->emailSendCount);
1716

0 commit comments

Comments
 (0)