|
5 | 5 | */
|
6 | 6 | namespace Magento\Widget\Test\Unit\Block\Adminhtml\Widget\Instance\Edit\Chooser;
|
7 | 7 |
|
8 |
| -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; |
9 |
| - |
10 |
| -class ContainerTest extends \PHPUnit_Framework_TestCase |
| 8 | +class ContainerTest extends AbstractContainerTest |
11 | 9 | {
|
12 | 10 | /**
|
13 | 11 | * @var \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Container
|
14 | 12 | */
|
15 | 13 | protected $containerBlock;
|
16 | 14 |
|
17 |
| - /** |
18 |
| - * @var \Magento\Framework\Event\Manager|\PHPUnit_Framework_MockObject_MockObject |
19 |
| - */ |
20 |
| - protected $eventManagerMock; |
21 |
| - |
22 |
| - /** |
23 |
| - * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject |
24 |
| - */ |
25 |
| - protected $scopeConfigMock; |
26 |
| - |
27 |
| - /** |
28 |
| - * @var \Magento\Backend\Block\Context|\PHPUnit_Framework_MockObject_MockObject |
29 |
| - */ |
30 |
| - protected $contextMock; |
31 |
| - |
32 |
| - /** |
33 |
| - * @var \Magento\Theme\Model\Resource\Theme\Collection|\PHPUnit_Framework_MockObject_MockObject |
34 |
| - */ |
35 |
| - protected $themeCollectionMock; |
36 |
| - |
37 |
| - /** |
38 |
| - * @var \Magento\Theme\Model\Resource\Theme\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject |
39 |
| - */ |
40 |
| - protected $themeCollectionFactoryMock; |
41 |
| - |
42 |
| - /** |
43 |
| - * @var \Magento\Theme\Model\Theme|\PHPUnit_Framework_MockObject_MockObject |
44 |
| - */ |
45 |
| - protected $themeMock; |
46 |
| - |
47 |
| - /** |
48 |
| - * @var \Magento\Framework\View\Layout\ProcessorFactory|\PHPUnit_Framework_MockObject_MockObject |
49 |
| - */ |
50 |
| - protected $layoutProcessorFactoryMock; |
51 |
| - |
52 |
| - /** |
53 |
| - * @var \Magento\Framework\View\Model\Layout\Merge|\PHPUnit_Framework_MockObject_MockObject |
54 |
| - */ |
55 |
| - protected $layoutMergeMock; |
56 |
| - |
57 |
| - /** |
58 |
| - * @var \Magento\Framework\Escaper|\PHPUnit_Framework_MockObject_MockObject |
59 |
| - */ |
60 |
| - protected $escaperMock; |
61 |
| - |
62 |
| - /** |
63 |
| - * @var ObjectManagerHelper |
64 |
| - */ |
65 |
| - protected $objectManagerHelper; |
66 |
| - |
67 | 15 | /**
|
68 | 16 | * @return void
|
69 | 17 | */
|
70 | 18 | protected function setUp()
|
71 | 19 | {
|
72 |
| - $this->objectManagerHelper = new ObjectManagerHelper($this); |
73 |
| - |
74 |
| - $this->eventManagerMock = $this->getMockBuilder('Magento\Framework\Event\Manager') |
75 |
| - ->setMethods(['dispatch']) |
76 |
| - ->disableOriginalConstructor() |
77 |
| - ->getMock(); |
78 |
| - $this->scopeConfigMock = $this->getMockBuilder('Magento\Framework\App\Config') |
79 |
| - ->setMethods(['getValue']) |
80 |
| - ->disableOriginalConstructor() |
81 |
| - ->getMock(); |
82 |
| - |
83 |
| - $this->themeCollectionFactoryMock = $this->getMock( |
84 |
| - 'Magento\Theme\Model\Resource\Theme\CollectionFactory', |
85 |
| - ['create'], |
86 |
| - [], |
87 |
| - '', |
88 |
| - false |
89 |
| - ); |
90 |
| - $this->themeCollectionMock = $this->getMockBuilder('Magento\Theme\Model\Resource\Theme\Collection') |
91 |
| - ->disableOriginalConstructor() |
92 |
| - ->setMethods(['getItemById']) |
93 |
| - ->getMock(); |
94 |
| - $this->themeMock = $this->getMockBuilder('Magento\Theme\Model\Theme')->disableOriginalConstructor()->getMock(); |
95 |
| - |
96 |
| - $this->layoutProcessorFactoryMock = $this->getMock( |
97 |
| - 'Magento\Framework\View\Layout\ProcessorFactory', |
98 |
| - ['create'], |
99 |
| - [], |
100 |
| - '', |
101 |
| - false |
102 |
| - ); |
103 |
| - |
104 |
| - $this->layoutMergeMock = $this->getMockBuilder('Magento\Framework\View\Model\Layout\Merge') |
105 |
| - ->setMethods(['addPageHandles', 'load', 'getContainers']) |
106 |
| - ->disableOriginalConstructor() |
107 |
| - ->getMock(); |
108 |
| - |
109 |
| - $this->escaperMock = $this->getMock('Magento\Framework\Escaper', ['escapeHtml'], [], '', false); |
110 |
| - |
111 |
| - $this->contextMock = $this->getMockBuilder('Magento\Backend\Block\Context') |
112 |
| - ->setMethods(['getEventManager', 'getScopeConfig', 'getEscaper']) |
113 |
| - ->disableOriginalConstructor() |
114 |
| - ->getMock(); |
115 |
| - $this->contextMock->expects($this->once())->method('getEventManager')->willReturn($this->eventManagerMock); |
116 |
| - $this->contextMock->expects($this->once())->method('getScopeConfig')->willReturn($this->scopeConfigMock); |
117 |
| - $this->contextMock->expects($this->once())->method('getEscaper')->willReturn($this->escaperMock); |
| 20 | + parent::setUp(); |
118 | 21 |
|
119 | 22 | $this->containerBlock = $this->objectManagerHelper->getObject(
|
120 | 23 | 'Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Container',
|
|
0 commit comments