Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractCacheSetCommandTest.php
Go to the documentation of this file.
1 <?php
8 
10 {
14  public function executeDataProvider()
15  {
16  return [
17  'implicit all' => [
18  [],
19  ['A', 'B', 'C'],
20  ['A', 'B', 'C'],
21  $this->getExpectedExecutionOutput(['A', 'B', 'C']),
22  ],
23  'specified types' => [
24  ['types' => ['A', 'B']],
25  ['A', 'B'],
26  ['A', 'B'],
27  $this->getExpectedExecutionOutput(['A', 'B']),
28  ],
29  'no changes' => [
30  ['types' => ['A', 'B']],
31  ['A', 'B'],
32  [],
33  $this->getExpectedExecutionOutput([]),
34  ],
35  ];
36  }
37 
45  public function getExpectedChangeOutput(array $changes, $enabled)
46  {
47  if ($changes) {
48  $output = 'Changed cache status:' . PHP_EOL;
49  foreach ($changes as $type) {
50  $output .= sprintf('%30s: %d -> %d', $type, $enabled === false, $enabled === true) . PHP_EOL;
51  }
52  } else {
53  $output = 'There is nothing to change in cache status' . PHP_EOL;
54  }
55  return $output;
56  }
57 }
$type
Definition: item.phtml:13