/** * @param array $data * @param CompetencyInterface $entity */ protected function assertDataEquals(array $data, $entity) { // `competency_id`,`pcrs_id` $this->assertEquals($data[0], $entity->getId()); // find the PCRS $pcrsId = $data[1]; $pcrs = $entity->getAamcPcrses()->filter(function (AamcPcrsInterface $pcrs) use($pcrsId) { return $pcrs->getId() === $pcrsId; })->first(); $this->assertNotEmpty($pcrs); }
/** * @param array $data * @param CompetencyInterface $entity */ protected function assertDataEquals(array $data, $entity) { // `competency_id`,`title`,`parent_competency_id`,`school_id` $this->assertEquals($data[0], $entity->getId()); $this->assertEquals($data[1], $entity->getTitle()); if (empty($data[2])) { $this->assertNull($entity->getParent()); } else { $this->assertEquals($data[2], $entity->getParent()->getId()); } $this->assertEquals($data[3], $entity->getSchool()->getId()); }