Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CacheFilesTest.php
Go to the documentation of this file.
1 <?php
7 
8 class CacheFilesTest extends \PHPUnit\Framework\TestCase
9 {
14  public function testCacheConfig($area)
15  {
16  $validationStateMock = $this->createMock(\Magento\Framework\Config\ValidationStateInterface::class);
17  $validationStateMock->expects($this->any())->method('isValidationRequired')->will($this->returnValue(true));
18 
20 
22  $reader = $objectManager->create(
23  \Magento\Framework\Cache\Config\Reader::class,
24  ['validationState' => $validationStateMock]
25  );
26  try {
27  $reader->read($area);
28  } catch (\Magento\Framework\Exception\LocalizedException $exception) {
29  $this->fail($exception->getMessage());
30  }
31  }
32 
33  public function cacheConfigDataProvider()
34  {
35  return ['global' => ['global'], 'adminhtml' => ['adminhtml'], 'frontend' => ['frontend']];
36  }
37 }
$objectManager
Definition: bootstrap.php:17