/** * {@inheritdoc} */ public function normalize(Log $log) { if (!$log instanceof TreeLog) { return []; } elseif (null === $log->getNode()) { throw new Exception('The log do not contains any node and wants to be serialized?'); } return array_merge(['_id' => $log->getId(), 'parent' => $log->getParentIdentifier(), 'status' => $log->getStatus()], $this->nodeNormalizer->normalize($log->getNode())); }
/** * @Then the log should be archived */ public function theLogShouldBeArchived() { $raw = $this->log->getNode()->jsonSerialize(); if (!array_key_exists('archived', $raw)) { throw new \RuntimeException('The log is not archived'); } }