/** * Check whether stockable is in stock or not. * * @param StockableInterface $stockable * * @return Boolean */ public function isStockAvailable(StockableInterface $stockable) { return $this->checker->isStockAvailable($stockable); }
function it_delegates_the_stock_availability_checking_to_the_checker(AvailabilityCheckerInterface $checker, StockableInterface $stockable) { $checker->isStockAvailable($stockable)->shouldBeCalled()->willReturn(true); $this->isStockAvailable($stockable)->shouldReturn(true); }