Example #1
0
 /**
  * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php
  * @magentoDataFixture Magento/Backend/controllers/_files/cache/application_cache.php
  * @magentoDataFixture Magento/Core/_files/layout_cache.php
  */
 public function testSaveAfterClearCache()
 {
     /** @var $appCache \Magento\Framework\App\Cache */
     $appCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\Cache');
     /** @var \Magento\Framework\App\Cache\Type\Layout $layoutCache */
     $layoutCache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\Cache\\Type\\Layout');
     $this->assertNotEmpty($appCache->load('APPLICATION_FIXTURE'));
     $this->assertNotEmpty($layoutCache->load('LAYOUT_CACHE_FIXTURE'));
     /** @var $layoutUpdate \Magento\Core\Model\Layout\Update */
     $layoutUpdate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Core\\Model\\Layout\\Update');
     $this->_resourceModel->save($layoutUpdate);
     $this->assertNotEmpty($appCache->load('APPLICATION_FIXTURE'), 'Non-layout cache must be kept');
     $this->assertFalse($layoutCache->load('LAYOUT_CACHE_FIXTURE'), 'Layout cache must be erased');
 }
Example #2
0
 /**
  * Get update string
  *
  * @param string $handle
  * @return string
  */
 protected function _getDbUpdateString($handle)
 {
     return $this->_resource->fetchUpdatesByHandle($handle, $this->_theme, $this->_store);
 }