public function testIsSingleQueryWhenSeveralConnectionsExist() { $queryData['checkout'] = false; $this->cacheMock->expects($this->once())->method('load')->with('connection_config_cache')->willReturn(false); $this->configMock->expects($this->once())->method('getConnectionName')->with('checkout_setup')->willReturn('checkout'); $this->cacheMock->expects($this->once())->method('save')->with(serialize($queryData), 'connection_config_cache', []); $this->assertFalse($this->quoteResolver->isSingleQuery()); }
/** * @return \Magento\Backend\Block\Widget\Grid */ protected function _prepareCollection() { $collection = $this->_quotesFactory->create(); if ($this->queryResolver->isSingleQuery()) { $collection->prepareForProductsInCarts(); $collection->setSelectCountSqlType(\Magento\Reports\Model\Resource\Quote\Collection::SELECT_COUNT_SQL_TYPE_CART); } else { $collection->prepareActiveCartItems(); } $this->setCollection($collection); return parent::_prepareCollection(); }