@param MockConfig $expectation

@return bool
177000
private function bodyConditionIsRegex(MockConfig $expectation)
    {
        return $expectation->getRequest()->getBody()
            && Matchers::MATCHES === $expectation->getRequest()->getBody()->getMatcher();
    }
472878
protected function assertGreaterThan($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertGreaterThan($expected, $actual, $message);
    }
1220588
public function equals($expected): bool
    {
        if (!is_scalar($expected) && null != $expected) {
            throw new \InvalidArgumentException(
                    'Can only compare scalar values and null.'
            );
        }

        return $expected === $this->value;
    }
186921
private function fillWithBodyMatches(Expectation $expectation, ServerRequestInterface $httpRequest, $responseBody)
    {
        if ($this->bodyConditionIsRegex($expectation)) {
            return $this->replaceMatches(
                'body',
                $expectation->getRequest()->getBody()->getValue(),
                $httpRequest->getBody()->__toString(),
                $responseBody
            );
        }

        return $responseBody;
    }
141722
public function iClickOn($element)
    {
        $page = $this->getSession()->getPage();
        $findName = $page->find("css", $element);

        if (!$findName) {
            throw new ExpectationException(
                $element . " could not be found",
                $this->getSession()->getDriver()
            );
        }

        $findName->click();
    }
696415
public function it_should_call_listeners_for_their_events_when_event_is_triggered(
        MockListener $listener,
        Event $event
    ) {
        $event->hasBeenHandled()
              ->willReturn(\false);
        $listener->method1($event, 'test1', $this)
                 ->willReturn($event);
        $this->addListener('test1', [$listener, 'method1']);
        $this->getListeners()
             ->shouldHaveKey('test1');
        $listener->method1($event, 'test1', $this)
                 ->shouldBeCalled();
        $this->trigger('test1', $event);
    }
98052
public function seeInEmailSubject($expected)
    {
        $email = $this->fetchLastMessage();
        $this->assertContains($expected, $email->subject, 'Email subject contains text');
    }
408993
public function withMock($mock)
    {
        if (is_string($mock)) {
            $mock = new $mock;
        }

        $this->mock = $mock;

        return $this;
    }
620520
public function assertSatisfied()
    {
        foreach ($this->expectations as $expectation) {
            if (!$expectation->isSatisfied()) {
                $comment = $expectation->commentOn($expectation->getMethod(), []);

                if (!$comment) {
                    $comment = "Unsatisfied expectation for method " . $expectation->getMethod();
                }

                throw new UnsatisfiedExpectationException($comment);
            }
        }
    }
126754
public static function match($actual, $expected)
    {
        $actual = static::_nl($actual);
        $expected = static::_nl($expected);
        return $actual == $expected;
    }
49404
public static function match($actual, $expected)
    {
        $length = static::actual($actual);
        static::_buildDescription($actual, $length, $expected);

        return $length === $expected;
    }
779656
public function verifyServiceExpectations($service)
    {
        try {
            $service->mockery_verify();
        } catch (CountValidatorException $exception) {
            throw new ExpectationException('One of the expected services was not called', $this->mink->getSession(), $exception);
        }
    }
733118
public function verify()
    {
        if ($this->groupIndex < $this->sequenceIndex) {
            throw new PHPUnit_Framework_ExpectationFailedException(
              sprintf(
                "The expected invocation at method '%s' group-index %d was never reached.",

                $this->method,
                $this->sequenceIndex
              )
            );
        }
    }
910849
public function equals(ServerRequestInterface $httpRequest, MockConfig $expectation)
    {
        $this->logger->debug('Checking if request matches an expectation');

        if (!$this->isExpectedScenarioState($expectation)) {
            return false;
        }

        $expectedRequest = $expectation->getRequest();

        $atLeastOneExecution = $this->compareRequestParts($httpRequest, $expectedRequest);

        if (null !== $atLeastOneExecution && $expectedRequest->getHeaders()) {
            $this->logger->debug('Checking headers against expectation');

            return $this->requestHeadersMatchExpectation($httpRequest, $expectedRequest);
        }

        return (bool) $atLeastOneExecution;
    }
1249952
public function equalTo($expected): Expect {
            $this->testsTheEqualityAgainstAValue = true;
            $this->expected = $expected;

            return $this;
        }
715689
function Expectation (spec, options) {
  this.id = ++id;
  // Static fields:
  this.specification = spec;
  spec.expectations.push(this);
  this.stopOnFailure = spec.stopOnFailure;
  this.verbose = spec.verbose;
  // Optional fields:
  this.thunk = undefined;
  this.code = undefined;
  this.weight = 1;
  Object.assign(this, options || {});
  spec.description.log_("Expectation: " + this.actual);
  this.index = ++this.specification.index;
  this.specification.expectationAttempted += this.weight;
  // Internal (dynamic) fields:
  this.raisedException = false;
  this.exception = null;
  this.pass = false;
  this.runEndHook = false;
}
229074
private function bodyConditionIsRegex(Expectation $expectation)
    {
        return $expectation->getRequest()->getBody()
            && Matchers::MATCHES === $expectation->getRequest()->getBody()->getMatcher();
    }