private function assertEntityResult(array $entity, array $expected) { //Assert individual props of each entity (if we want them, make sure they are there) if (in_array('info', $expected['props'])) { $this->assertEntityPropsInfo($entity); } if (in_array('datatype', $expected['props'])) { $this->assertArrayHasKey('type', $entity, 'An entity is missing the type value'); } if (in_array('sitelinks', $expected['props'])) { $this->assertEntityPropsSitelinksBadges($entity); } if (in_array('sitelinks/urls', $expected['props'])) { $this->assertEntityPropsSitelinksUrls($entity); } if (array_key_exists('dir', $expected) && array_key_exists('sitelinks', $entity)) { $this->assertEntitySitelinkSorting($entity, $expected); } //Assert the whole entity is as expected (claims, sitelinks, aliases, descriptions, labels) $expectedEntityOutput = EntityTestHelper::getEntityOutput(EntityTestHelper::getHandle($entity['id']), $expected['props'], $expected['languages']); $this->assertEntityEquals($expectedEntityOutput, $entity, false); }