Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCacheInvalidatePopUp.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\PageCache\Test\Page\Adminhtml\AdminCache;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertCacheInvalidatePopUp extends AbstractConstraint
16 {
22  private $cacheTypes = [
23  'block_html' => "Blocks HTML output",
24  ];
25 
33  public function processAssert(AdminCache $adminCache, array $caches)
34  {
35  foreach ($caches as $cacheType => $cacheStatus) {
36  if ($cacheStatus === 'Invalidated') {
37  \PHPUnit\Framework\Assert::assertContains(
38  $this->cacheTypes[$cacheType],
39  $adminCache->getSystemMessageDialog()->getPopupText()
40  );
41  } else {
42  \PHPUnit\Framework\Assert::assertNotContains(
43  $this->cacheTypes[$cacheType],
44  $adminCache->getSystemMessageDialog()->getPopupText()
45  );
46  }
47  }
48  }
49 
55  public function toString()
56  {
57  return 'Cache invalidate pop up is correct.';
58  }
59 }