Example #1
0
 public function testBuildGroupModelEntities()
 {
     $entity1 = new CeModelEntity();
     $entity1->setIsQualified(false);
     $entity2 = new CeModelEntity();
     $entity2->setIsQualified(true);
     $entity3 = new CeModelEntity();
     $entity3->setIsQualified(true);
     $this->model->addModelEntity($entity1);
     $this->model->addModelEntity($entity2);
     $this->model->addModelEntity($entity3);
     $this->model->buildGroupModelEntities();
     $this->assertCount(2, $this->model->getQualifiedModelEntities(), 'Invalid count of qualified model entities.');
     $this->assertCount(1, $this->model->getNonQualifiedModelEntities(), 'Invalid count of non qualified model entities.');
     $this->model->removeModelEntity($entity1);
     $this->model->removeModelEntity($entity2);
     $this->assertCount(1, $this->model->getQualifiedModelEntities(), 'Invalid count of qualified model entities after model was removed.');
     $this->assertCount(0, $this->model->getNonQualifiedModelEntities(), 'Invalid count of non qualified model entities after model was removed.');
 }