Exemplo n.º 1
0
 public function testCreate()
 {
     $offer = new Offer();
     $offer->setActive(false);
     $offer->setCreatedOn(new \DateTime('now'));
     $offer->setDescription('The first offer created with phpunit test');
     $offer->setDisabled(false);
     $offer->setModificationDate(new \DateTime('now'));
     $offer->setPhisicalStock(10);
     $offer->setPrice(1500.2);
     $offer->setUsed(false);
 }
Exemplo n.º 2
0
 /**
  * @abstract Business - enble Offer function
  * @param Offer $offer
  * @throws Exception
  */
 public function enableOffer(Offer $offer)
 {
     try {
         if (!$offer->isEnabled()) {
             $offer->setUpdateOn(new \DateTime('now'));
             $offer->setEnable(true);
             $this->persistAndFlush($offer);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }