Sanpi\Behatch\HttpCall\HttpCallListener::afterStep PHP Метод

afterStep() публичный Метод

public afterStep ( Behat\Behat\EventDispatcher\Event\AfterStepTested $event )
$event Behat\Behat\EventDispatcher\Event\AfterStepTested
    public function afterStep(AfterStepTested $event)
    {
        $testResult = $event->getTestResult();
        if (!$testResult instanceof ExecutedStepResult) {
            return;
        }
        $httpCallResult = new HttpCallResult($testResult->getCallResult()->getReturn());
        if ($this->contextSupportedVoter->vote($httpCallResult)) {
            $this->httpCallResultPool->store($httpCallResult);
            return true;
        }
        // For now to avoid modification on MinkContext
        // We add fallback on Mink
        try {
            $this->httpCallResultPool->store(new HttpCallResult($this->mink->getSession()->getPage()->getContent()));
        } catch (\LogicException $e) {
            // Mink has no response
        } catch (\Behat\Mink\Exception\DriverException $e) {
            // No Mink
        }
    }