assertTrue(method_exists(NativeKey::class, '__toString'), 'Class does not have method __toString'); $this->assertEquals('database', (string) NativeKey::database()); $this->assertEquals('collection', (string) NativeKey::collection()); $this->assertEquals('media_type', (string) NativeKey::mediaType()); $this->assertEquals('record_identifier', (string) NativeKey::recordIdentifier()); } /** * @dataProvider keyProvider */ public function testGetIndexField($key, $field) { $this->assertEquals($key->getIndexField(), $field); } public function keyProvider() { return [ [NativeKey::database(), 'databox_name'], [NativeKey::collection(), 'collection_name'], [NativeKey::mediaType(), 'type'], [NativeKey::recordIdentifier(), 'record_id'] ]; } }