urlBuilderMock = $this->getMockBuilder(UrlInterface::class)->getMock(); $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class)->getMock(); $this->model = new CheckoutSummaryConfigProvider($this->urlBuilderMock, $this->scopeConfigMock); } public function testGetConfig() { $maxItemsCount = 10; $cartUrl = 'url/to/cart/page'; $expectedResult = [ 'maxCartItemsToDisplay' => $maxItemsCount, 'cartUrl' => $cartUrl ]; $this->urlBuilderMock->expects($this->once())->method('getUrl')->with('checkout/cart')->willReturn($cartUrl); $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with('checkout/options/max_items_display_count', ScopeInterface::SCOPE_STORE) ->willReturn($maxItemsCount); $this->assertEquals($expectedResult, $this->model->getConfig()); } }