本文整理汇总了PHP中PHPUnit_Framework_TestCase::assertType方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestCase::assertType方法的具体用法?PHP PHPUnit_Framework_TestCase::assertType怎么用?PHP PHPUnit_Framework_TestCase::assertType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestCase
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestCase::assertType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertInstanceOf
/**
* Calls assertType() or assertInstanceOf() depending on the PHPUnit version.
* Available from PHPUnit >= 3.5
*
* @param string $expected Expected value
* @param mixed $actual Actual value
* @param string $message Message to print if assertion is wrong
*/
public static function assertInstanceOf($expected, $actual, $message = '')
{
if (self::_checkMethod('assertInstanceOf')) {
parent::assertInstanceOf($expected, $actual, $message);
} else {
parent::assertType($expected, $actual, $message);
}
}
示例2: assertType
/**
* Calls assertType() of parent class if available.
* Available from PHPUnit <= 3.5
*
* @param mixed $expected Expected value
* @param mixed $actual Actual value
* @param string $message Message to print if assertion is wrong
* @throws Exception If assertType() method is not available
*/
public static function assertType($expected, $actual, $message = '')
{
if (self::_checkMethod('assertType')) {
parent::assertType($expected, $actual, $message);
} else {
throw new Exception('assertType() is removed since phpunit >= 3.5');
}
}
示例3: assertType
public static function assertType($x, $y)
{
#global $phpunit_version;
if (version_compare(PHPUnit_Runner_Version::id(), '3.5') < 0) {
return PHPUnit_Framework_TestCase::assertType($x, $y);
} else {
return PHPUnit_Framework_TestCase::assertInternalType($x, $y);
}
}
示例4: isa_ok
/**
* Overwritten lime_test method
*
* @see lime_test#isa_ok()
*/
public function isa_ok($var, $class, $message = '')
{
// PHPUnit: void assertType(string $expected, mixed $actual, string $message)
$some = $this->testCase->assertType($class, $var, $message);
}
示例5: assertInternalType
/**
* Helper method to allow PHPUnit versions < 3.5.x
*
* @param string $expected The expected internal type.
* @param mixed $actual The actual variable/value.
* @param string $message Optional error/fail message.
*
* @return void
* @since 0.10.2
*/
public static function assertInternalType($expected, $actual, $message = '')
{
if (is_callable(get_parent_class(__CLASS__) . '::') . __FUNCTION__) {
return parent::assertInternalType($expected, $actual, $message);
}
return parent::assertType($expected, $actual, $message);
}
示例6: assertIsA
protected function assertIsA($object, $class, $message = '')
{
parent::assertType($class, $object, $message);
}