public function testGetTypes() { $expectedCacheTypes = array('single_tag' => array('id' => 'single_tag', 'cache_type' => 'Tag One', 'description' => 'This is Tag One', 'tags' => 'TAG_ONE', 'status' => 0), 'multiple_tags' => array('id' => 'multiple_tags', 'cache_type' => 'Tags One and Two', 'description' => 'These are Tags One and Two', 'tags' => 'TAG_ONE,TAG_TWO', 'status' => 0)); $actualCacheTypes = $this->_model->getTypes(); $this->assertInternalType('array', $actualCacheTypes); $this->assertEquals(array_keys($expectedCacheTypes), array_keys($actualCacheTypes)); foreach ($actualCacheTypes as $cacheId => $cacheTypeData) { /** @var $cacheTypeData Varien_Object */ $this->assertInstanceOf('Varien_Object', $cacheTypeData); $this->assertEquals($expectedCacheTypes[$cacheId], $cacheTypeData->getData()); } }
public function testGetTypes() { /* Expect cache types introduced by Mage_Core module which can not be disabled */ $expectedCacheTypes = array('config', 'layout', 'block_html', 'translate', 'collections'); $expectedKeys = array('id', 'cache_type', 'description', 'tags', 'status'); $actualCacheTypesData = $this->_model->getTypes(); $actualCacheTypes = array_keys($actualCacheTypesData); /* Assert that all expected cache types are present */ $this->assertEquals($expectedCacheTypes, array_intersect($expectedCacheTypes, $actualCacheTypes)); foreach ($actualCacheTypesData as $cacheTypeData) { /** @var $cacheTypeData Varien_Object */ //$this->assertInstanceOf('Varien_Object', $cacheTypeData); $this->assertEquals($expectedKeys, array_keys($cacheTypeData->getData())); } }