public function testGetRelatedOrders() { $visibleStatuses = []; $orderCollection = $this->getMock('Magento\\Sales\\Model\\ResourceModel\\Order\\Collection', ['addFieldToSelect', 'addFieldToFilter', 'setOrder'], [], '', false); $orderCollection->expects($this->at(0))->method('addFieldToSelect')->will($this->returnValue($orderCollection)); $orderCollection->expects($this->at(1))->method('addFieldToFilter')->will($this->returnValue($orderCollection)); $orderCollection->expects($this->at(2))->method('addFieldToFilter')->with('status', ['in' => $visibleStatuses])->will($this->returnValue($orderCollection)); $orderCollection->expects($this->at(3))->method('setOrder')->will($this->returnValue($orderCollection)); $this->orderCollectionFactory->expects($this->once())->method('create')->will($this->returnValue($orderCollection)); $this->orderConfig->expects($this->once())->method('getVisibleOnFrontStatuses')->will($this->returnValue($visibleStatuses)); $this->block->getRelatedOrders(); }