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.');
 }
 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.');
 }
 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.');
 }
 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.');
 }
 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.');
 }
Exemple #6
0
/**
 * 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);
}