@param string $scenario
@param string $scenarioState

@return self
508555
public function andScenarioState($scenario, $scenarioState)
    {
        $this->scenarioName = new ScenarioName($scenario);
        $this->scenarioIs = new ScenarioState($scenarioState);

        return $this;
    }
139855
protected function validateScenarioStateOrThrowException(
        MockConfig $expectation,
        LoggerInterface $logger
    ) {
        if ($expectation->getResponse()->hasNewScenarioState() && !$expectation->getRequest()->hasScenarioState()) {
            $logger->error('Scenario states misconfiguration');
            throw new \RuntimeException(
                'Trying to set scenario state without specifying scenario previous state'
            );
        }
    }
262800
public function check(string $scenario, string $token): bool
    {
        $t    = microtime(true);
        $data = Params::get($this->id, $scenario);
        $this->handle($token, $data);
        if ($this->Debug) {
            $this->Debug->check($this->id, $scenario, $this->code, microtime(true) - $t);
        }
        return $this->code === self::VALID;
    }
1356212
def before_scenario(context, scenario):
    """"""

    # Prepare a new temporary directory.
    context.directory = testfixtures.TempDirectory(create=True)
    context.old_cwd = os.getcwd()
    context.new_cwd = context.directory.path

    # Move into our new working directory.
    os.chdir(context.new_cwd)
584444
static Scenario scenario(String text) {
        reset();
        final Scenario scenario = new Scenario(text);
        sRoot = scenario;
        return scenario;
    }
274005
public function orWhere(...$conditions) : self
    {
        $this->conditionalQueryBuilder->orWhere(
            ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
360569
final public function onValidationScenario(string $scenario, array $parameters = []): self
    {
        [$on, $extend] = $this->getValidationSchemasName($scenario);

        $this->validationScenarios = \compact('on', 'extend', 'parameters');

        return $this;
    }
410682
protected function validateScenarioStateOrThrowException(
        Expectation $expectation,
        LoggerInterface $logger
    ) {
        if ($expectation->getNewScenarioState() && !$expectation->getScenarioStateIs()) {
            $logger->error('Scenario states misconfiguration');
            throw new \RuntimeException(
                'Trying to set scenario state without specifying scenario previous state'
            );
        }
    }
354420
public function setState(State $state = null): AbstractTable
    {
        $this->current = new State($this->initial->getName());

        if (!empty($state)) {
            $this->current->setName($state->getName());
            $this->current->syncState($state);
        }

        return $this;
    }
970805
public function cleanAssetsAfterScenario(ScenarioEvent $event) {
        foreach(\File::get() as $file) {
            if(file_exists($file->getFullPath())) $file->delete();
        }
    }
629547
public function where($conditions): self
    {
        if ($conditions[0] instanceof Closure) {
            $this->addClauseCondClosure('where', 'AND', $conditions[0]);

            return $this;
        }
        $this->where[] = ['and', $conditions];

        return $this;
    }
159001
public function run(Runnable $scenario, Dispatchable $event)
    {
        $scenario->setDispatcher($this->dispatcher);
        $scenario->inject($event);

        return $scenario->run();
    }
788851
public function setSuccessOn($clause, IContext &$context = null)
    {
        $isSuccess = is_callable($clause) ? $clause($context) : $clause;
        $isSuccess ? $this->setSuccess($context) : $this->setFail($context);

        return $context;
    }
1313001
public UserScenario createUserScenario(final UserScenario scenario) {
        return invoke(USER_SCENARIOS,
                new RequestClosure<JsonObject>() {
                    @Override
                    public JsonObject call(Invocation.Builder request) {
                        String         json = scenario.toJSON().toString();
                        Entity<String> data = Entity.entity(json, MediaType.APPLICATION_JSON_TYPE);
                        return request.post(data, JsonObject.class);
                    }
                },
                new ResponseClosure<JsonObject, UserScenario>() {
                    @Override
                    public UserScenario call(JsonObject json) {
                        return new UserScenario(json);
                    }
                }
        );
    }
450374
public function getScenarioState(ScenarioName $name)
    {
        $nameString = $name->asString();
        if (!isset($this->scenarios[$nameString])) {
            $this->scenarios[$nameString] = new ScenarioState(self::INITIAL_SCENARIO);
        }

        return $this->scenarios[$nameString];
    }
1271014
private function getTags(ScenarioInterface $scenario)
    {
        if (! $scenario->hasTags()) {
            return $this->indent();
        }

        return $this->indent() . (new Tags())->format($scenario->getTags()) . "\n";
    }
313159
public function havingRaw(string $condition): self
    {
        $this->condition->having([new RawExp($condition)]);

        return $this;
    }