@@ -19,8 +19,16 @@ class MenuTest extends \PHPUnit_Framework_TestCase
19
19
*/
20
20
protected $ blockMenu ;
21
21
22
+ /** @var \Magento\Framework\App\Cache\Type\Config $configCacheType */
23
+ protected $ configCacheType ;
24
+
22
25
protected function setUp ()
23
26
{
27
+ $ this ->configCacheType = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
28
+ 'Magento\Framework\App\Cache\Type\Config '
29
+ );
30
+ $ this ->configCacheType ->save ('' , \Magento \Backend \Model \Menu \Config::CACHE_MENU_OBJECT );
31
+
24
32
$ this ->blockMenu = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
25
33
'Magento\Backend\Block\Menu '
26
34
);
@@ -65,7 +73,10 @@ protected function prepareMenuConfig()
65
73
66
74
return \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
67
75
'Magento\Backend\Model\Menu\Config ' ,
68
- ['configReader ' => $ configReader ]
76
+ [
77
+ 'configReader ' => $ configReader ,
78
+ 'configCacheType ' => $ this ->configCacheType
79
+ ]
69
80
);
70
81
}
71
82
@@ -81,4 +92,12 @@ protected function loginAdminUser()
81
92
$ auth = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->get ('Magento\Backend\Model\Auth ' );
82
93
$ auth ->login (\Magento \TestFramework \Bootstrap::ADMIN_NAME , \Magento \TestFramework \Bootstrap::ADMIN_PASSWORD );
83
94
}
95
+
96
+ /**
97
+ * @return void
98
+ */
99
+ protected function tearDown ()
100
+ {
101
+ $ this ->configCacheType ->save ('' , \Magento \Backend \Model \Menu \Config::CACHE_MENU_OBJECT );
102
+ }
84
103
}
0 commit comments