Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
IndexSwitcherMock.php
Go to the documentation of this file.
1 <?php
8 
12 class IndexSwitcherMock extends \PHPUnit\Framework\Assert implements IndexSwitcherInterface
13 {
14  private $isSwitched = false;
15 
19  private $indexSwitcher;
20 
24  public function __construct(
25  IndexSwitcherInterface $indexSwitcher
26  ) {
27  $this->indexSwitcher = $indexSwitcher;
28  }
29 
38  public function switchIndex(array $dimensions)
39  {
40  $this->isSwitched |= true;
41  $this->indexSwitcher->switchIndex($dimensions);
42  }
43 
47  public function isSwitched()
48  {
49  return (bool) $this->isSwitched;
50  }
51 }
__construct(IndexSwitcherInterface $indexSwitcher)