当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_Assert::assertType方法代码示例

本文整理汇总了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.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:8,代码来源:003_lock_null_resource_success_assertions.php

示例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.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:8,代码来源:008_unlock_resource_success_assertions.php

示例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.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:9,代码来源:021_copy_resource_destination_not_locked_success_assertions.php

示例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.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:9,代码来源:014_move_resource_both_locked_success_assertions.php

示例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.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:9,代码来源:013_unlock_wrong_token_success_assertions.php

示例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);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Functions.php


注:本文中的PHPUnit_Framework_Assert::assertType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。