本文整理汇总了PHP中PHPUnit_Framework_Assert::assertType方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertType方法的具体用法?PHP PHPUnit_Framework_Assert::assertType怎么用?PHP PHPUnit_Framework_Assert::assertType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertLockDiscoveryPropertyCorrect
public function assertLockDiscoveryPropertyCorrect(ezcWebdavMemoryBackend $backend)
{
$prop = $backend->getProperty('/collection/newresource.xml', 'lockdiscovery');
PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not set.');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Lock discovery property has incorrect type.');
PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Number of activeLock elements incorrect.');
PHPUnit_Framework_Assert::assertEquals(new ezcWebdavPotentialUriContent('http://example.com/some/user', true), $prop->activeLock[0]->owner, 'Lock owner not correct.');
}
示例2: assertLockDiscoveryPropertyNowhere
public function assertLockDiscoveryPropertyNowhere(ezcWebdavMemoryBackend $backend)
{
$prop = $backend->getProperty('/collection', 'lockdiscovery');
PHPUnit_Framework_Assert::assertNull($prop);
$prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.');
PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly.');
}
示例3: assertSourceStillThere
public function assertSourceStillThere(ezcWebdavMemoryBackend $backend)
{
PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/collection/resource.html'));
$prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery');
PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property removed from source.');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop);
PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Active lock element removed from source.');
PHPUnit_Framework_Assert::assertEquals('opaquelocktoken:1234', $prop->activeLock[0]->token->__toString(), 'Active lock token on destination parent incorrect.');
}
示例4: assertDestinationCorrect
public function assertDestinationCorrect(ezcWebdavMemoryBackend $backend)
{
PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/other_collection/moved_resource.html'));
$prop = $backend->getProperty('/other_collection/moved_resource.html', 'lockdiscovery');
PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not available on destination.');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop);
PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Active lock element not available on destination.');
PHPUnit_Framework_Assert::assertEquals('opaquelocktoken:5678', $prop->activeLock[0]->token->__toString(), 'Active lock token on destination incorrect.');
}
示例5: assertLockDiscoveryPropertyStillCorrect
public function assertLockDiscoveryPropertyStillCorrect(ezcWebdavMemoryBackend $backend)
{
$prop = $backend->getProperty('/collection', 'lockdiscovery');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.');
PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock element not removed correctly from root.');
$prop = $backend->getProperty('/collection/resource.html', 'lockdiscovery');
PHPUnit_Framework_Assert::assertType('ezcWebdavLockDiscoveryProperty', $prop, 'Property has incorrect type.');
PHPUnit_Framework_Assert::assertEquals(1, count($prop->activeLock), 'Active lock element not present in null resource anymore.');
}
示例6: assertType
/**
* Asserts that a variable is of a given type.
*
* @param string $expected
* @param mixed $actual
* @param string $message
* @deprecated
*/
function assertType($expected, $actual, $message = '')
{
return PHPUnit_Framework_Assert::assertType($expected, $actual, $message);
}