35 $this->objectManagerMock = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
36 $this->identifierMock = $this->createMock(\
Magento\Customer\CustomerData\Section\Identifier::class);
37 $this->sectionSourceMap = [
'section1' =>
'b'];
39 $this->objectManagerMock,
40 $this->identifierMock,
41 $this->sectionSourceMap
47 $sectionNames = [
'section1'];
48 $sectionsData = [
'data1',
'data2'];
55 $identifierResult = [1, 2, 3];
57 $sectionSourceMock = $this->createMock(\
Magento\Customer\CustomerData\SectionSourceInterface::class);
58 $this->objectManagerMock->expects($this->once())
61 ->willReturn($sectionSourceMock);
62 $sectionSourceMock->expects($this->once())->method(
'getSectionData')->willReturn($sectionsData);
64 $this->identifierMock->expects($this->once())
65 ->method(
'markSections')
67 ->with($allSectionsData, $sectionNames,
false)
68 ->willReturn($identifierResult);
69 $modelResult = $this->model->getSectionsData($sectionNames);
70 $this->assertEquals($identifierResult, $modelResult);
80 $identifierResult = [1, 2, 3];
81 $this->objectManagerMock->expects($this->once())
84 ->willReturn($this->model);
85 $modelResult = $this->model->getSectionsData($sectionNames);
86 $this->assertEquals($identifierResult, $modelResult);
testGetSectionsDataAllSectionsException()
testGetSectionsDataAllSections()