diff --git a/plugins/bc-custom-content/src/Model/Entity/CustomField.php b/plugins/bc-custom-content/src/Model/Entity/CustomField.php index 5a39223ead..379bfd5382 100644 --- a/plugins/bc-custom-content/src/Model/Entity/CustomField.php +++ b/plugins/bc-custom-content/src/Model/Entity/CustomField.php @@ -47,6 +47,7 @@ class CustomField extends Entity * @return string * @checked * @noTodo + * @unitTest */ public function getTypeTitle(): string { diff --git a/plugins/bc-custom-content/tests/TestCase/Model/Entity/CustomFieldTest.php b/plugins/bc-custom-content/tests/TestCase/Model/Entity/CustomFieldTest.php new file mode 100644 index 0000000000..38f6211a37 --- /dev/null +++ b/plugins/bc-custom-content/tests/TestCase/Model/Entity/CustomFieldTest.php @@ -0,0 +1,45 @@ +CustomField = $this->getTableLocator()->get('BcCustomContent.CustomFields'); + } + + public function tearDown(): void + { + unset($this->CustomField); + parent::tearDown(); + } + + /** + * test getTypeTitle + */ + public function test_getTypeTitle() + { + // type group + $customField = new CustomField([ + 'id' => 1, + 'custom_table_id' => 1, + 'type' => 'group', + ]); + $this->assertEquals('グループ', $customField->getTypeTitle()); + // type text + $customField = new CustomField([ + 'id' => 1, + 'custom_table_id' => 1, + 'type' => 'text', + ]); + $this->assertEmpty($customField->getTypeTitle()); + } + +} \ No newline at end of file