Skip to content

Commit

Permalink
Save test
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed May 20, 2021
1 parent ca23a44 commit ef18d79
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/phpunit/CRM/Core/BAO/CustomFieldTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Civi\Api4\CustomField;

/**
* Class CRM_Core_BAO_CustomFieldTest
*
Expand Down Expand Up @@ -949,12 +951,12 @@ public function testGetFieldsForImport() {
/**
* 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',
Expand All @@ -967,12 +969,12 @@ public function testBulkCreate() {
'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);
Expand Down

0 comments on commit ef18d79

Please sign in to comment.