Project

General

Profile

Bug #22694 » 14455_test.diff

Administrator Admin, 2010-06-06 02:59

View differences:

tests/t3lib/cache/backend/t3lib_cache_backend_memcachedbackendtestcase.php (working copy)
}
/**
* @test
*/
public function setManyTags() {
$backend = $this->setUpBackend();
$tags = array();
for($i = 0; $i<100; $i++) {
$tags[] = strval(rand());
}
$microtimeBeforeSet = microtime(1);
$backend->set('dataWithManyTags', '42', $tags);
$microtimeAfterSet = microtime(1);
$this->assertLessThan(0.0001, $microtimeAfterSet - $microtimeBeforeSet, 'Setting takes too long');
}
/**
* @test
*/
public function dropManyTags() {
$backend = $this->setUpBackend();
$tags = array();
for($i = 0; $i<100; $i++) {
$tags[] = strval(rand());
}
$backend->set('dataWithManyTags', '42', $tags);
$microtimeBeforeSet = microtime(1);
$backend->flush();
$microtimeAfterSet = microtime(1);
$this->assertLessThan(0.0001, $microtimeAfterSet - $microtimeBeforeSet, 'Dropping takes too long');
}
/**
* Sets up the memcached backend used for testing
*
* @param array $backendOptions Options for the memcache backend
(2-2/2)