/** * @dataProvider provideConstructor */ public function testConstructor($fields) { $term = new TermIndexEntry($fields); $entityId = null; if (isset($fields['entityType']) && isset($fields['entityId'])) { // FIXME: This must be removed once we got rid of all legacy numeric ids. $entityId = LegacyIdInterpreter::newIdFromTypeAndNumber($fields['entityType'], $fields['entityId']); } $this->assertEquals(isset($fields['entityType']) ? $fields['entityType'] : null, $term->getEntityType()); $this->assertEquals($entityId, $term->getEntityId()); $this->assertEquals(isset($fields['termType']) ? $fields['termType'] : null, $term->getType()); $this->assertEquals(isset($fields['termLanguage']) ? $fields['termLanguage'] : null, $term->getLanguage()); $this->assertEquals(isset($fields['termText']) ? $fields['termText'] : null, $term->getText()); $this->assertEquals(isset($fields['termWeight']) ? $fields['termWeight'] : null, $term->getWeight()); }