context = $this->createMock(\Magento\Framework\View\Element\Template\Context::class); $this->sectionConfig = $this->createMock(\Magento\Framework\Config\DataInterface::class); $this->encoder = $this->createMock(\Magento\Framework\Json\EncoderInterface::class); $this->objectManagerHelper = new ObjectManagerHelper($this); $this->block = $this->objectManagerHelper->getObject( \Magento\Customer\Block\SectionConfig::class, [ 'context' => $this->context, 'sectionConfig' => $this->sectionConfig ] ); } public function testGetSections() { $this->sectionConfig->expects($this->once())->method('get')->with('sections')->willReturn(['data']); $this->assertEquals(['data'], $this->block->getSections()); } }