/** * * @param \Mcustiel\Phiremock\Domain\Expectation $foundExpectation */ private function processScenario($foundExpectation) { if ($foundExpectation->getNewScenarioState()) { if (!$foundExpectation->getScenarioName()) { throw new \RuntimeException('Expecting scenario state without specifying scenario name'); } $this->scenarioStorage->setScenarioState($foundExpectation->getScenarioName(), $foundExpectation->getNewScenarioState()); } }
protected function validateScenarioNameOrThrowException(Expectation $expectation, LoggerInterface $logger) { if (!$expectation->getScenarioName() && ($expectation->getScenarioStateIs() || $expectation->getNewScenarioState())) { $logger->error('Scenario name related misconfiguration'); throw new \RuntimeException('Expecting or trying to set scenario state without specifying scenario name'); } }