PHPUnit_Framework_Assert::assertInternalType PHP Method

assertInternalType() public static method

Asserts that a variable is of a given type.
public static assertInternalType ( string $expected, mixed $actual, string $message = '' )
$expected string
$actual mixed
$message string
    public static function assertInternalType($expected, $actual, $message = '')
    {
        if (!is_string($expected)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
        }
        $constraint = new PHPUnit_Framework_Constraint_IsType($expected);
        static::assertThat($actual, $constraint, $message);
    }

Usage Example

 public static function get($url, $options = [], $caller = __METHOD__)
 {
     PHPUnit_Framework_Assert::assertInternalType('string', $url);
     PHPUnit_Framework_Assert::assertInternalType('array', $options);
     PHPUnit_Framework_Assert::assertInternalType('string', $caller);
     return self::$response;
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertInternalType
PHPUnit_Framework_Assert