diff --git a/CustomFieldType/DateOperatorTrait.php b/CustomFieldType/DateOperatorTrait.php new file mode 100644 index 000000000..042f1754f --- /dev/null +++ b/CustomFieldType/DateOperatorTrait.php @@ -0,0 +1,33 @@ +assertSame('Option B', $customField->valueToLabel('option_b')); } + public function testValueToLabelWithInteger(): void + { + $customField = new CustomField(); + $optionB = new CustomFieldOption(); + $optionB->setLabel('1'); + $optionB->setValue('1'); + $customField->addOption($optionB); + $customField->setTypeObject( + new SelectType( + $this->createMock(TranslatorInterface::class), + $this->createMock(FilterOperatorProviderInterface::class) + ) + ); + $this->assertSame('1', $customField->valueToLabel('1')); + } + public function testValueToLabelIfOptionNotFound(): void { $customField = new CustomField();