46 public function test(Widget $widget, array $caches = [])
49 $this->caches = $caches;
51 $this->widgetInstanceIndex->open();
52 $this->widgetInstanceIndex->getPageActionsBlock()->addNew();
53 $this->widgetInstanceNew->getWidgetForm()->fill($widget);
54 $this->widgetInstanceEdit->getPageActionsBlock()->save();
55 $this->adjustCacheSettings();
63 private function adjustCacheSettings()
65 $this->cache->flush();
66 foreach ($this->caches as $cacheType => $cacheStatus) {
67 if ($cacheStatus ===
'Disabled') {
68 $this->cache->disableCache($cacheType);
71 if (in_array(
'Invalidated', $this->caches)) {
72 $this->cmsIndex->open();
84 if (!empty($this->caches)) {
85 $this->cache->enableCache();