Build the description of the runned `::match()` call.

@param string $actual   The actual type.
@param string $expected The expected type.
480531
public static function _buildDescription($actual, $expected)
    {
        $description = "have the expected type.";
        $data['actual'] = $actual;
        $data['expected'] = $expected;
        static::$_description = compact('description', 'data');
    }
1001371
private function isMatch(Rule $expected, array $value): bool
    {
        return 0 === count(array_diff(array_keys($expected->getReflectedMap()), array_keys($value)));
    }
1095559
private function requestMethodMatchesExpectation(ServerRequestInterface $httpRequest, Request $expectedRequest)
    {
        $inputSource = $this->inputSourceFactory->createFromConfig([
            'method' => null,
        ]);
        $matcher = $this->matcherFactory->createFromConfig([
            Matchers::SAME_STRING => $expectedRequest->getMethod(),
        ]);

        return $this->evaluate($inputSource, $matcher, $httpRequest);
    }
292657
protected function assertArrayEquals(array $actual, array $expected)
    {
        $propertyAccessor = new PropertyAccessor();

        foreach ($expected as $key => $needle) {
            $expectedValue = $expected[$key];

            // Fix type
            if ($expectedValue == '@true') {
                $expectedValue = true;
            } else if ($expectedValue == '@false') {
                $expectedValue = false;
            } else if ($expectedValue == '@null') {
                $expectedValue = null;
            } else if (preg_match('/^@\[([^\]]+)?\]$/', $expectedValue, $parts)) {
                if (!empty($parts[1])) {
                    $expectedValue = explode(',', $parts[1]);
                    $expectedValue = array_map('trim', $expectedValue);
                } else {
                    $expectedValue = [];
                }
            }

            if (strpos($key, '[') !== false) {
                // Try get value via "PropertyPath"
                $elements = explode('[', $key);
                $elements = array_map(function ($element){
                    return trim($element, '][');
                }, $elements);

                $propertyPath = '[' . implode($elements, '][') . ']';

                $propertyPath = new PropertyPath($propertyPath);
                $actualValue = $propertyAccessor->getValue($actual, $propertyPath);
                $rootKey = $propertyPath->getElement(0);
            } else {
                $actualValue = $actual[$key];
                $rootKey = $key;
            }

            Assertions::assertArrayHasKey($rootKey, $actual, sprintf(
                'Not found key "%s" in array (%s).',
                $rootKey,
                json_encode($actual)
            ));

            if ($expectedValue == '@notNull') {
                Assertions::assertNotNull($actualValue, sprintf(
                    'Failed assert equals for key "%s". Expected: NOT NULL. Body: "%s"',
                    $key,
                    $this->response->getBody()
                ));
            } else {
                Assertions::assertEquals($expectedValue, $actualValue, sprintf(
                    'Failed assert equals for key "%s". Expected: "%s"; Actual: "%s". Body: "%s"',
                    $key,
                    is_scalar($expectedValue) ? $expectedValue : (is_array($expectedValue) ? 'Array(' . json_encode($expectedValue) . ')' : 'Invalid type'),
                    is_scalar($actualValue) ? $actualValue : (is_array($actualValue) ? 'Array(' . json_encode($actualValue) . ')' : 'Invalid type'),
                    $this->response->getBody()
                ));
            }
        }
    }
599576
protected function compareMail($actualMail, $expectedMail)
    {
        // Make sure there is the same number of actual and expected.
        $expectedCount = count($expectedMail);
        $this->assertMailCount($actualMail, $expectedCount);

        // For each row of expected mail, check the corresponding actual mail.
        // Make the comparison insensitive to the order mails were sent.
        $actualMail = $this->sortMail($actualMail);
        $expectedMail = $this->sortMail($expectedMail);
        foreach ($expectedMail as $index => $expectedMailItem) {
            // For each column of the expected, check the field of the actual mail.
            foreach ($expectedMailItem as $fieldName => $fieldValue) {
                $expectedField = [$fieldName => $fieldValue];
                $match = $this->matchesMail($actualMail[$index], $expectedField);
                if (!$match) {
                    throw new \Exception(sprintf("The #%s mail did not have '%s' in its %s field. It had:\n'%s'", $index, $fieldValue, $fieldName, mb_strimwidth($actualMail[$index][$fieldName], 0, 30, "...")));
                }
            }
        }
    }
367645
protected function assertGreaterThanOrEqual($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertGreaterThanOrEqual($expected, $actual, $message);
    }
472878
protected function assertGreaterThan($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertGreaterThan($expected, $actual, $message);
    }
1048606
public static function assertHasItems($expected, $actual, $message='') {
        Assert::assertThat(
            $actual,
            new HasItems($expected),
            $message);
    }
449311
public function match($actual = '')
    {
        $isMatch = $this->doMatch($actual);
        $isNegated = $this->isNegated();

        return new Match($isMatch xor $isNegated, $this->expected, $actual, $isNegated);
    }
49404
public static function match($actual, $expected)
    {
        $length = static::actual($actual);
        static::_buildDescription($actual, $length, $expected);

        return $length === $expected;
    }
1321142
public function typeOf($actual, $expected, $message = '')
    {
        $this->assertion->setActual($actual);

        return $this->assertion->to->be->a($expected, $message);
    }
15035
public function assertNotPartialOutput($expected, $type = 'stdout')
    {
        $expected = (string) $expected;
        $actual = $this->getOutputByType($type);

        if (false !== strpos($actual, $expected)) {
            throw new ExpectationException("Failed to assert \"$actual\" does not contain \"$expected\"");
        }
    }
844267
public function compareString($expected, $actual)
    {
        $expected .= "\0";
        $actual .= "\0";
        $expectedLength = StringHelper::byteLength($expected);
        $actualLength = StringHelper::byteLength($actual);
        $diff = $expectedLength - $actualLength;
        for ($i = 0; $i < $actualLength; $i++) {
            $diff |= (ord($actual[$i]) ^ ord($expected[$i % $expectedLength]));
        }
        return $diff === 0;
    }
657750
public static function assertLooselyEquals($actual, $expected, Throwable $exception)
    {
        /** @noinspection TypeUnsafeComparisonInspection This assertion is wanted to be unsafe type. */
        static::makeAssertion($actual == $expected, $exception);
        return $actual;
    }
968004
static function isArraySame($expected, $actual) {

		if (Arrays::isNumeric($actual) and Arrays::isNumeric($expected)) {
			sort($expected);
			sort($actual);
		} else {
			asort($expected);
			asort($actual);
		}
		
		return $expected === $actual;
	}
174356
public static function match($actual, $expected)
    {
        if (is_callable($expected)) {
            return $expected($actual);
        }
        $actual = static::_nl($actual);
        return !!preg_match($expected, $actual);
    }
1213462
public static boolean isSimilar(final String expected, final String actual) {
        final Diff diff = createDiffResult(expected, actual, true);

        return diff.similar();
    }