/** * @param array $data * @param MeshConceptInterface $entity */ protected function assertDataEquals(array $data, $entity) { // `mesh_concept_uid`,`mesh_semantic_type_uid` $this->assertEquals($data[0], $entity->getId()); // find the semantic type $semanticTypeId = $data[1]; $semanticType = $entity->getSemanticTypes()->filter(function (MeshSemanticTypeInterface $semanticType) use($semanticTypeId) { return $semanticType->getId() === $semanticTypeId; })->first(); $this->assertNotEmpty($semanticType); }