@param string $expected expected instance name
@param mixed $actual actual instance

@return InvalidArgumentException
196764
public static function factory($expected, $actual)
    {
        return new self(sprintf(
            'Expected instance of %s. Got %s',
            $expected,
            is_object($actual) ? get_class($actual) : gettype($actual)
        ));
    }
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()
                ));
            }
        }
    }
1082111
public void giveDetails( Expectation expected, Object actual )
    {
        this.expected = expected;
        this.actual = actual;
        this.detailed = true;
    }
396913
protected function assertLessThan($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertLessThan($expected, $actual, $message);
    }
739767
protected function assertNotSame($expected, $actual, $message = '')
    {
        \PHPUnit\Framework\Assert::assertNotSame($expected, $actual, $message);
    }
1006596
public static function invalidType(string $expected, $parameter) : InvalidArgumentException
    {
        $message = sprintf(
            'Invalid Argument type: "%s" expected, "%s" given',
            $expected,
            is_object($parameter) ? get_class($parameter) : gettype($parameter)
        );

        return new self($message);
    }
1142761
public static function fromValue(
        $expected_type,
        $actual_value,
        DeserializationContext $context = null
    ) {
        if (null !== $context && count($context->getCurrentPath()) > 0) {
            $property = sprintf('property "%s" to be ', implode('.', $context->getCurrentPath()));
        } else {
            $property = '';
        }

        return new static(sprintf(
            'Expected %s%s, but got %s: %s',
            $property,
            $expected_type,
            gettype($actual_value),
            json_encode($actual_value)
        ));
    }
487937
public static function create(
        $expected,
        $actual,
        $paramNo = null,
        $code = null,
        $previous = null
    ) {
        $msgMsk = 'Expected %1$s. Got %2$s';

        if ($paramNo !== null) {
            $msgMsk = 'Param #%3$s '.lcfirst($msgMsk);
        }

        if ($code !== null) {
            $msgMsk = '[%4$s] '.$msgMsk;
        }

        $class = get_called_class();
        return new $class(
            sprintf(
                $msgMsk,
                $expected,
                Debug::summarise($actual),
                $paramNo,
                $code
            ),
            is_int($code) ? $code : null,
            $previous
        );
    }
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;
	}
543733
final protected function throwIfInvalidAnnotation(string $classWithAnnotation, string $annotation, string $expectedClassName, string $actualClassName): void
    {
        if (!is_a($actualClassName, $expectedClassName, true)) {
            throw new Exception('On class `' . $classWithAnnotation . '` the annotation `@API\\' . $annotation . '` expects a FQCN implementing `' . $expectedClassName . '`, but instead got: ' . $actualClassName);
        }
    }
1155754
public static function expected($expected)
    {
        if ($expected === 'bool') {
            $expected = 'boolean';
        }
        if ($expected === 'int') {
            $expected = 'integer';
        }
        if ($expected === 'float') {
            $expected = 'double';
        }
        return strtolower($expected);
    }
861588
public static function assertStringMatchIgnoreWhitespace(
        $expected, $actual, $message='') {
          Assert::assertThat(
            $actual,
            new StringMatchIgnoreWhitespace($expected),
            $message);
    }
1075978
protected function assertEquals($expected, $actual, $message = '', $delta = 0.0)
    {
        \PHPUnit\Framework\Assert::assertEquals($expected, $actual, $message, $delta);
    }
395603
public void assertEquals(Object expected, Object actual) {
    if (expected == null && actual == null)
      return;
    if (expected != null && expected.equals(actual))
      return;
    fail(format(expected, actual));
  }
1372038
public static function invalidType($name, $value, $expectedType)
    {
        return new static(sprintf('Expected %s to have type "%s" but found "%s"', $name, $expectedType, is_object($value) ? get_class($value) : gettype($value)));
    }
816974
public static function match($actual, $expected = null)
    {
        $a = static::actual($actual);
        static::_buildDescription($a, $expected);

        return $a === $expected;
    }
610875
public static function match($actual, $expected)
    {
        $a = static::actual($actual);
        $e = static::expected($expected);

        static::_buildDescription($a, $e);
        return $a === $e;
    }