X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Ftests%2Fsrc%2FUnit%2FCache%2FCacheDataCollectorTest.php;fp=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Ftests%2Fsrc%2FUnit%2FCache%2FCacheDataCollectorTest.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=f4673eea7dc2c643f7d6d4f9c3b91a4b258cbacb;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/web/modules/contrib/devel/webprofiler/tests/src/Unit/Cache/CacheDataCollectorTest.php b/web/modules/contrib/devel/webprofiler/tests/src/Unit/Cache/CacheDataCollectorTest.php deleted file mode 100644 index f4673eea7..000000000 --- a/web/modules/contrib/devel/webprofiler/tests/src/Unit/Cache/CacheDataCollectorTest.php +++ /dev/null @@ -1,69 +0,0 @@ -cacheDataCollector = new CacheDataCollector(); - $this->cacheBackendInterface = $this->getMock('Drupal\Core\Cache\CacheBackendInterface'); - } - - /** - * Tests the collection of a cache miss. - */ - public function testCacheCollectorMiss() { - $this->cacheBackendInterface->expects($this->once()) - ->method('get') - ->will($this->returnValue(FALSE)); - - $cacheBackendWrapper = new CacheBackendWrapper($this->cacheDataCollector, $this->cacheBackendInterface, 'default'); - $cache = $cacheBackendWrapper->get('cache_id'); - - $this->assertFalse($cache); - - $this->assertEquals(1, $this->cacheDataCollector->getCacheMissesCount()); - } - - /** - * Tests the collection of a cache hit. - */ - public function testCacheCollectorHit() { - $cache = new \StdClass(); - $cache->cid = 'cache_id'; - $cache->expire = 1; - $cache->tags = ['tag1', 'tag2']; - $this->cacheBackendInterface->expects($this->once()) - ->method('get') - ->will($this->returnValue($cache)); - - $cacheBackendWrapper = new CacheBackendWrapper($this->cacheDataCollector, $this->cacheBackendInterface, 'default'); - $cache2 = $cacheBackendWrapper->get('cache_id'); - - $this->assertNotNull($cache2); - - $this->assertEquals(1, $this->cacheDataCollector->getCacheHitsCount()); - } - -}