@@ -18,7 +18,69 @@ class DataTest extends \PHPUnit_Framework_TestCase
18
18
19
19
protected function setUp ()
20
20
{
21
- $ this ->model = (new ObjectManager ($ this ))->getObject (\Magento \Theme \Model \Theme \Data::class);
21
+ $ customizationConfig = $ this ->getMock (\Magento \Theme \Model \Config \Customization::class, [], [], '' , false );
22
+ $ this ->customizationFactory = $ this ->getMock (
23
+ \Magento \Framework \View \Design \Theme \CustomizationFactory::class,
24
+ ['create ' ],
25
+ [],
26
+ '' ,
27
+ false
28
+ );
29
+ $ this ->resourceCollection = $ this ->getMock (
30
+ \Magento \Theme \Model \ResourceModel \Theme \Collection::class,
31
+ [],
32
+ [],
33
+ '' ,
34
+ false
35
+ );
36
+ $ this ->_imageFactory = $ this ->getMock (
37
+ \Magento \Framework \View \Design \Theme \ImageFactory::class,
38
+ ['create ' ],
39
+ [],
40
+ '' ,
41
+ false
42
+ );
43
+ $ this ->themeFactory = $ this ->getMock (
44
+ \Magento \Framework \View \Design \Theme \FlyweightFactory::class,
45
+ ['create ' ],
46
+ [],
47
+ '' ,
48
+ false
49
+ );
50
+ $ this ->domainFactory = $ this ->getMock (
51
+ \Magento \Framework \View \Design \Theme \Domain \Factory::class,
52
+ ['create ' ],
53
+ [],
54
+ '' ,
55
+ false
56
+ );
57
+ $ this ->themeModelFactory = $ this ->getMock (
58
+ \Magento \Theme \Model \ThemeFactory::class,
59
+ ['create ' ],
60
+ [],
61
+ '' ,
62
+ false
63
+ );
64
+ $ this ->validator = $ this ->getMock (\Magento \Framework \View \Design \Theme \Validator::class, [], [], '' , false );
65
+ $ this ->appState = $ this ->getMock (\Magento \Framework \App \State::class, [], [], '' , false );
66
+
67
+ $ objectManagerHelper = new ObjectManager ($ this );
68
+ $ arguments = $ objectManagerHelper ->getConstructArguments (
69
+ \Magento \Theme \Model \Theme \Data::class,
70
+ [
71
+ 'customizationFactory ' => $ this ->customizationFactory ,
72
+ 'customizationConfig ' => $ customizationConfig ,
73
+ 'imageFactory ' => $ this ->_imageFactory ,
74
+ 'resourceCollection ' => $ this ->resourceCollection ,
75
+ 'themeFactory ' => $ this ->themeFactory ,
76
+ 'domainFactory ' => $ this ->domainFactory ,
77
+ 'validator ' => $ this ->validator ,
78
+ 'appState ' => $ this ->appState ,
79
+ 'themeModelFactory ' => $ this ->themeModelFactory
80
+ ]
81
+ );
82
+
83
+ $ this ->model = $ objectManagerHelper ->getObject (\Magento \Theme \Model \Theme \Data::class, $ arguments );
22
84
}
23
85
24
86
/**
0 commit comments