本文整理汇总了PHP中PHPUnit_Framework_Assert::isType方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::isType方法的具体用法?PHP PHPUnit_Framework_Assert::isType怎么用?PHP PHPUnit_Framework_Assert::isType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::isType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isType
/**
* Returns a PHPUnit_Framework_Constraint_IsType matcher object.
*
* @param string $type
* @return PHPUnit_Framework_Constraint_IsType
* @since Method available since Release 3.0.0
*/
function isType($type)
{
return PHPUnit_Framework_Assert::isType($type);
}
示例2: testConstraintIsNotType2
/**
* @covers PHPUnit_Framework_Constraint_IsType
* @covers PHPUnit_Framework_Constraint_Not
* @covers PHPUnit_Framework_Assert::isType
* @covers PHPUnit_Framework_Assert::logicalNot
*/
public function testConstraintIsNotType2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::isType('string'));
try {
$constraint->fail('', 'custom message', TRUE);
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals("custom message\nFailed asserting that <string:> is not of type \"string\".", $e->getDescription());
return;
}
$this->fail();
}
示例3: testConstraintIsNotType2
/**
* @covers PHPUnit_Framework_Constraint_IsType
* @covers PHPUnit_Framework_Constraint_Not
* @covers PHPUnit_Framework_Assert::isType
* @covers PHPUnit_Framework_Assert::logicalNot
* @covers PHPUnit_Framework_TestFailure::exceptionToString
*/
public function testConstraintIsNotType2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::isType('string'));
try {
$constraint->evaluate('', 'custom message');
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals(<<<EOF
custom message
Failed asserting that '' is not of type "string".
EOF
, PHPUnit_Framework_TestFailure::exceptionToString($e));
return;
}
$this->fail();
}
示例4: iRequestToAuthenticate
/**
* @When I request to authenticate
*/
public function iRequestToAuthenticate()
{
try {
$this->apiResponse = $this->api->getToken($this->credentials);
} catch (Exception $e) {
$this->apiResponse = $e->getMessage();
}
PHPUnit_Framework_Assert::isType("array");
}
示例5: toBeJson
public function toBeJson()
{
if ($this->negate) {
a::assertThat($this->actual, a::logicalAnd(a::isType('string'), a::logicalNot(a::isJson())));
} else {
a::assertJson($this->actual);
}
}
示例6: thePropertyIsAString
/**
* @Given /^the "([^"]*)" property is a string$/
*/
public function thePropertyIsAString($property)
{
$payload = $this->getScopePayload();
PHPUnit_Framework_Assert::isType('string', $this->arrayGet($payload, $property), "Asserting the [{$property}] property in current scope [{$this->scope}] is a string: " . json_encode($payload));
}