public function FeedsHTTPCacheTest::testClear in Feeds 7.2
@covers FeedsHTTPCache::clear().
Tests if a single cached file can get cleaned up.
File
- tests/
FeedsHTTPCacheTest.test, line 286
Class
- FeedsHTTPCacheTest
- @coversDefaultClass FeedsHTTPCache @group feeds
Code
public function testClear() {
// Create a few cache entries.
$cid1 = $this
->createCacheRecordUsingApi();
$cid2 = $this
->createCacheRecordUsingApi();
// Assert that items were created in the database.
$this
->assertCacheItemExists($cid1);
$this
->assertCacheItemExists($cid2);
// Assert that files exist.
$this
->assertCacheFileExists($cid1);
$this
->assertCacheFileExists($cid2);
// Now clear first item.
$this->cache
->clear($cid1);
// Assert that item 1 is removed from the database, but item 2 still exists.
$this
->assertNoCacheItemExists($cid1);
$this
->assertCacheItemExists($cid2);
// Assert that file 1 is gone as well, but file 2 still exists.
$this
->assertNoCacheFileExists($cid1);
$this
->assertCacheFileExists($cid2);
}