Skip to content

Commit 95b2160

Browse files
committed
Fix the Magento/Theme/Test/Unit/Model/Theme/DataTest.php file buy passing all argurments into consturctor
1 parent 8fa6f73 commit 95b2160

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

app/code/Magento/Theme/Test/Unit/Model/Theme/DataTest.php

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,69 @@ class DataTest extends \PHPUnit_Framework_TestCase
1818

1919
protected function setUp()
2020
{
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);
2284
}
2385

2486
/**

0 commit comments

Comments
 (0)