Exemplo n.º 1
0
 public function testCurtainColoursOnDisplay()
 {
     $curtainDesign = new CurtainDesign();
     $curtainColour1 = new CurtainColour();
     $curtainColour1->setId(30);
     $curtainColour1->setName("two");
     $curtainColour1->setinStock(1);
     $curtainColour1->setDisplay(1);
     $curtainDesign->addCurtainColour($curtainColour1);
     $curtainColour3 = new CurtainColour();
     $curtainColour3->setId(40);
     $curtainColour3->setName("three");
     $curtainColour3->setinStock(1);
     $curtainColour3->setDisplay(0);
     $curtainDesign->addCurtainColour($curtainColour3);
     $curtainColour2 = new CurtainColour();
     $curtainColour2->setId(1);
     $curtainColour2->setName("one");
     $curtainColour2->setinStock(0);
     $curtainColour2->setDisplay(1);
     $curtainDesign->addCurtainColour($curtainColour2);
     $onDisplayColours = $curtainDesign->getCurtainColoursOnDisplay();
     reset($onDisplayColours);
     $this->assertEquals("two", current($onDisplayColours)->getName());
     $this->assertEquals("one", next($onDisplayColours)->getName());
 }