/** * {@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 have the status :status */ public function theLogShouldHaveTheStatus($status) { if ($status != $this->log->getStatus()) { throw new \RuntimeException(sprintf('Found status %s instead of %s', $this->log->getStatus(), $status)); } }