<?php
+use Civi\Api4\CustomField;
+
/**
* Class CRM_Core_BAO_CustomFieldTest
*
/**
* Test the bulk create function works.
*/
- public function testBulkCreate() {
+ public function testBulkCreate(): void {
$customGroup = $this->customGroupCreate([
'extends' => 'Individual',
'title' => 'my bulk group',
]);
- CRM_Core_BAO_CustomField::bulkSave([
+ CustomField::save(FALSE)->setRecords([
[
'label' => 'Test',
'data_type' => 'String',
'html_type' => 'Link',
'is_search_range' => '0',
],
- ],
+ ])->setDefaults(
[
'custom_group_id' => $customGroup['id'],
'is_active' => 1,
'is_searchable' => 1,
- ]);
+ ])->execute();
$dao = CRM_Core_DAO::executeQuery(('SHOW CREATE TABLE ' . $customGroup['values'][$customGroup['id']]['table_name']));
$dao->fetch();
$this->assertContains('`test_link_2` varchar(255) COLLATE ' . CRM_Core_BAO_SchemaHandler::getInUseCollation() . ' DEFAULT NULL', $dao->Create_Table);