function it_find_previous_and_next_products($productManager, SequentialEdit $sequentialEdit, ProductInterface $product, ProductInterface $previous, ProductInterface $next) { $sequentialEdit->getObjectSet()->willReturn([1, 6, 5, 2]); $sequentialEdit->countObjectSet()->willReturn(4); $product->getId()->willReturn(5); $productManager->find(6)->willReturn($previous); $productManager->find(2)->willReturn($next); $sequentialEdit->setCurrent($product)->shouldBeCalled(); $sequentialEdit->setPrevious($previous)->shouldBeCalled(); $sequentialEdit->setNext($next)->shouldBeCalled(); $this->findWrap($sequentialEdit, $product); }
/** * {@inheritDoc} */ public function setCurrent(\Pim\Bundle\CatalogBundle\Model\ProductInterface $current) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCurrent', array($current)); return parent::setCurrent($current); }