Ejemplo n.º 1
0
 /**
  * @test
  * @return void
  */
 public function getCurrentPriceReturnsPriceOptionIfSet()
 {
     $this->subject->setPrice(19.99);
     $priceOption1 = new PriceOption();
     $priceOption1->setPrice(14.99);
     $priceOption1->setValidUntil(new \DateTime('today'));
     $priceOption2 = new PriceOption();
     $priceOption2->setPrice(16.99);
     $priceOption2->setValidUntil(new \DateTime('tomorrow'));
     $this->subject->addPriceOptions($priceOption1);
     $this->subject->addPriceOptions($priceOption2);
     $this->assertEquals(14.99, $this->subject->getCurrentPrice());
 }