mShippingStateMock = $this->createMock(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::class); $this->model = $objectManager->getObject( \Magento\Multishipping\Block\Checkout\State::class, [ 'multishippingState' => $this->mShippingStateMock, ] ); } public function testGetSteps() { $this->mShippingStateMock->expects($this->once()) ->method('getSteps')->will($this->returnValue(['expected array'])); $this->assertEquals(['expected array'], $this->model->getSteps()); } }