コード例 #1
0
 public function testIsBreedable()
 {
     $couple = new PlantCouple($father = new CandyCanePlant(3), $mother = new CandyCanePlant(4));
     $this->assertTrue($couple->isBreedable());
     $mother->setHasBred(true);
     $this->assertFalse($couple->isBreedable());
     $father->setHasBred(true);
     $this->assertFalse($couple->isBreedable());
     $mother->setHasBred(false);
     $this->assertFalse($couple->isBreedable());
 }
コード例 #2
0
 public function testSetHasBred()
 {
     $plant = new CandyCanePlant(7);
     $plant->setHasBred(true);
     $this->assertTrue($plant->hasBred());
 }