diff --git a/tests/src/Kernel/CustomDataTypesTest.php b/tests/src/Kernel/CustomDataTypesTest.php index 5ba3ec7..97dca85 100644 --- a/tests/src/Kernel/CustomDataTypesTest.php +++ b/tests/src/Kernel/CustomDataTypesTest.php @@ -120,21 +120,26 @@ class CustomDataTypesTest extends KernelTestBase { $name_field = $item->getField('name'); $processed_value = $name_field->getValues()[0]; $processed_type = $name_field->getType(); + $label = $name_field->getLabel(); $this->assertEquals($original_value, $processed_value, 'The processed value matches the original value'); $this->assertEquals($original_type, $processed_type, 'The processed type matches the original type.'); + $this->assertEquals('Name', $label, 'The label is correctly set.'); // Reset the fields on the item and change to the supported data type. $item->setFieldsExtracted(FALSE); $item->setFields(array()); - $this->index->getField('name')->setType('search_api_test_data_type'); - $name_field = $item->getField('name'); + $this->index->getField('name') + ->setType('search_api_test_data_type') + ->setLabel("Test"); + $name_field = $item->getField('name'); $processed_value = $name_field->getValues()[0]; $processed_type = $name_field->getType(); $this->assertEquals($original_value, $processed_value, 'The processed value matches the original value'); $this->assertEquals('search_api_test_data_type', $processed_type, 'The processed type matches the new type.'); + $this->assertEquals('Test', $name_field->getLabel(), 'The label is correctly set.'); // Reset the fields on the item and change to the non-supported data type. $item->setFieldsExtracted(FALSE);