Skip to content

Commit d185e2c

Browse files
author
Dmytro Poperechnyy
committed
MAGETWO-42165: Widget has no containers for templates to be displayed in
1 parent 239a087 commit d185e2c

File tree

1 file changed

+0
-192
lines changed
  • app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser

1 file changed

+0
-192
lines changed

app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -201,81 +201,6 @@ public function testToHtmlCatalogProductsListGroupedProduct()
201201
$this->assertEquals($expectedHtml, $this->containerBlock->toHtml());
202202
}
203203

204-
/**
205-
* @return void
206-
*/
207-
public function testToHtmlCatalogEventsCarouselVirtualProduct()
208-
{
209-
$pageLayoutProcessorContainers = [
210-
'after.body.start' => 'Page Top',
211-
'columns.top' => 'Before Main Columns',
212-
'main' => 'Main Content Container',
213-
'page.bottom' => 'Before Page Footer Container',
214-
'before.body.end' => 'Page Bottom',
215-
'header.container' => 'Page Header Container',
216-
'page.top' => 'After Page Header',
217-
'footer-container' => 'Page Footer Container',
218-
'sidebar.main' => 'Sidebar Main',
219-
'sidebar.additional' => 'Sidebar Additional'
220-
];
221-
$layoutProcessorContainers = [
222-
'product.info.virtual.extra' => 'Product Extra Info',
223-
'header.panel' => 'Page Header Panel',
224-
'header-wrapper' => 'Page Header',
225-
'top.container' => 'After Page Header Top',
226-
'content.top' => 'Main Content Top',
227-
'content' => 'Main Content Area',
228-
'content.aside' => 'Main Content Aside',
229-
'content.bottom' => 'Main Content Bottom',
230-
'page.bottom' => 'Before Page Footer',
231-
'footer' => 'Page Footer',
232-
'cms_footer_links_container' => 'CMS Footer Links'
233-
];
234-
$allowedContainers = ['sidebar.main', 'content', 'sidebar.additional'];
235-
$expectedHtml = '<select name="block" id="" class="required-entry select" title="" '
236-
. 'onchange="WidgetInstance.loadSelectBoxByType(\'block_template\', this.up(\'div.group_container\'), '
237-
. 'this.value)"><option value="" selected="selected" >-- Please Select --</option><option value="content" >'
238-
. 'Main Content Area</option><option value="sidebar.additional" >Sidebar Additional</option>'
239-
. '<option value="sidebar.main" >Sidebar Main</option></select>';
240-
241-
$this->eventManagerMock->expects($this->once())->method('dispatch')->willReturn(true);
242-
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
243-
244-
$this->themeCollectionFactoryMock->expects($this->once())
245-
->method('create')
246-
->willReturn($this->themeCollectionMock);
247-
$this->themeCollectionMock->expects($this->once())->method('getItemById')->willReturn($this->themeMock);
248-
249-
$this->layoutProcessorFactoryMock->expects($this->exactly(2))
250-
->method('create')
251-
->willReturn($this->layoutMergeMock);
252-
$this->layoutMergeMock->expects($this->exactly(2))->method('addPageHandles')->willReturn(true);
253-
$this->layoutMergeMock->expects($this->exactly(2))->method('load')->willReturnSelf();
254-
$this->layoutMergeMock->expects($this->any())->method('addHandle')->willReturnSelf();
255-
$this->layoutMergeMock->expects($this->any())->method('getContainers')->willReturnOnConsecutiveCalls(
256-
$pageLayoutProcessorContainers,
257-
$layoutProcessorContainers
258-
);
259-
260-
$this->containerBlock->setAllowedContainers($allowedContainers);
261-
$this->containerBlock->setValue('');
262-
263-
$this->escaperMock->expects($this->any())->method('escapeHtml')->willReturnMap(
264-
[
265-
['', null, ''],
266-
['-- Please Select --', null, '-- Please Select --'],
267-
['content', null, 'content'],
268-
['Main Content Area', null, 'Main Content Area'],
269-
['sidebar.additional', null, 'sidebar.additional'],
270-
['Sidebar Additional', null, 'Sidebar Additional'],
271-
['sidebar.main', null, 'sidebar.main'],
272-
['Sidebar Main', null, 'Sidebar Main']
273-
]
274-
);
275-
276-
$this->assertEquals($expectedHtml, $this->containerBlock->toHtml());
277-
}
278-
279204
/**
280205
* @return void
281206
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
@@ -538,123 +463,6 @@ public function testToHtmlCmsStaticBlockAllProductTypes()
538463
$this->assertEquals($expectedHtml, $this->containerBlock->toHtml());
539464
}
540465

541-
/**
542-
* @return void
543-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
544-
*/
545-
public function testToHtmlBannerRotatorAllPages()
546-
{
547-
$pageLayoutProcessorContainers = [
548-
'after.body.start' => 'Page Top',
549-
'columns.top' => 'Before Main Columns',
550-
'main' => 'Main Content Container',
551-
'page.bottom' => 'Before Page Footer Container',
552-
'before.body.end' => 'Page Bottom',
553-
'header.container' => 'Page Header Container',
554-
'page.top' => 'After Page Header',
555-
'footer-container' => 'Page Footer Container',
556-
'sidebar.main' => 'Sidebar Main',
557-
'sidebar.additional' => 'Sidebar Additional'
558-
];
559-
$layoutProcessorContainers = [
560-
'header.panel' => 'Page Header Panel',
561-
'header-wrapper' => 'Page Header',
562-
'top.container' => 'After Page Header Top',
563-
'content.top' => 'Main Content Top',
564-
'content' => 'Main Content Area',
565-
'content.aside' => 'Main Content Aside',
566-
'content.bottom' => 'Main Content Bottom',
567-
'page.bottom' => 'Before Page Footer',
568-
'footer' => 'Page Footer',
569-
'cms_footer_links_container' => 'CMS Footer Links'
570-
];
571-
$allowedContainers = [];
572-
$expectedHtml = '<select name="block" id="" class="required-entry select" title="" '
573-
. 'onchange="WidgetInstance.loadSelectBoxByType(\'block_template\', this.up(\'div.group_container\'), '
574-
.'this.value)"><option value="" selected="selected" >-- Please Select --</option><option value="page.top" >'
575-
. 'After Page Header</option><option value="top.container" >After Page Header Top</option>'
576-
. '<option value="columns.top" >Before Main Columns</option><option value="page.bottom" >Before Page Footer'
577-
. '</option><option value="cms_footer_links_container" >CMS Footer Links</option><option value="content" >'
578-
. 'Main Content Area</option><option value="content.aside" >Main Content Aside</option>'
579-
. '<option value="content.bottom" >Main Content Bottom</option><option value="main" >Main Content Container'
580-
. '</option><option value="content.top" >Main Content Top</option><option value="before.body.end" >'
581-
. 'Page Bottom</option><option value="footer" >Page Footer</option><option value="footer-container" >'
582-
. 'Page Footer Container</option><option value="header-wrapper" >Page Header</option>'
583-
. '<option value="header.container" >Page Header Container</option><option value="header.panel" >'
584-
. 'Page Header Panel</option><option value="after.body.start" >Page Top</option>'
585-
. '<option value="sidebar.additional" >Sidebar Additional</option><option value="sidebar.main" >'
586-
. 'Sidebar Main</option></select>';
587-
588-
$this->eventManagerMock->expects($this->once())->method('dispatch')->willReturn(true);
589-
$this->scopeConfigMock->expects($this->once())->method('getValue')->willReturn(false);
590-
591-
$this->themeCollectionFactoryMock->expects($this->once())
592-
->method('create')
593-
->willReturn($this->themeCollectionMock);
594-
$this->themeCollectionMock->expects($this->once())->method('getItemById')->willReturn($this->themeMock);
595-
596-
$this->layoutProcessorFactoryMock->expects($this->exactly(2))
597-
->method('create')
598-
->willReturn($this->layoutMergeMock);
599-
$this->layoutMergeMock->expects($this->exactly(2))->method('addPageHandles')->willReturn(true);
600-
$this->layoutMergeMock->expects($this->exactly(2))->method('load')->willReturnSelf();
601-
$this->layoutMergeMock->expects($this->any())->method('addHandle')->willReturnSelf();
602-
$this->layoutMergeMock->expects($this->any())->method('getContainers')->willReturnOnConsecutiveCalls(
603-
$pageLayoutProcessorContainers,
604-
$layoutProcessorContainers
605-
);
606-
607-
$this->containerBlock->setAllowedContainers($allowedContainers);
608-
$this->containerBlock->setValue('');
609-
610-
$this->escaperMock->expects($this->any())->method('escapeHtml')->willReturnMap(
611-
[
612-
['', null, ''],
613-
['-- Please Select --', null, '-- Please Select --'],
614-
['page.top', null, 'page.top'],
615-
['After Page Header', null, 'After Page Header'],
616-
['top.container', null, 'top.container'],
617-
['After Page Header Top', null, 'After Page Header Top'],
618-
['columns.top', null, 'columns.top'],
619-
['Before Main Columns', null, 'Before Main Columns'],
620-
['page.bottom', null, 'page.bottom'],
621-
['Before Page Footer', null, 'Before Page Footer'],
622-
['cms_footer_links_container', null, 'cms_footer_links_container'],
623-
['CMS Footer Links', null, 'CMS Footer Links'],
624-
['content', null, 'content'],
625-
['Main Content Area', null, 'Main Content Area'],
626-
['content.aside', null, 'content.aside'],
627-
['Main Content Aside', null, 'Main Content Aside'],
628-
['content.bottom', null, 'content.bottom'],
629-
['Main Content Bottom', null, 'Main Content Bottom'],
630-
['main', null, 'main'],
631-
['Main Content Container', null, 'Main Content Container'],
632-
['content.top', null, 'content.top'],
633-
['Main Content Top', null, 'Main Content Top'],
634-
['before.body.end', null, 'before.body.end'],
635-
['Page Bottom', null, 'Page Bottom'],
636-
['footer', null, 'footer'],
637-
['Page Footer', null, 'Page Footer'],
638-
['footer-container', null, 'footer-container'],
639-
['Page Footer Container', null, 'Page Footer Container'],
640-
['header-wrapper', null, 'header-wrapper'],
641-
['Page Header', null, 'Page Header'],
642-
['header.container', null, 'header.container'],
643-
['Page Header Container', null, 'Page Header Container'],
644-
['header.panel', null, 'header.panel'],
645-
['Page Header Panel', null, 'Page Header Panel'],
646-
['after.body.start', null, 'after.body.start'],
647-
['Page Top', null, 'Page Top'],
648-
['sidebar.additional', null, 'sidebar.additional'],
649-
['Sidebar Additional', null, 'Sidebar Additional'],
650-
['sidebar.main', null, 'sidebar.main'],
651-
['Sidebar Main', null, 'Sidebar Main']
652-
]
653-
);
654-
655-
$this->assertEquals($expectedHtml, $this->containerBlock->toHtml());
656-
}
657-
658466
/**
659467
* @return void
660468
*/

0 commit comments

Comments
 (0)