* @dataProvider basicXmlTestCases
*/
public function testBasicXMLExports($customGroupParams, $fieldParams, $expectedXmlFilePath) {
* @dataProvider basicXmlTestCases
*/
public function testBasicXMLExports($customGroupParams, $fieldParams, $expectedXmlFilePath) {
- $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', array(
- 1 => array($customGroupParams['title'], 'String'),
- ));
+ $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', [
+ 1 => [$customGroupParams['title'], 'String'],
+ ]);
$customGroup = $this->customGroupCreate($customGroupParams);
$fieldParams['custom_group_id'] = $customGroup['id'];
$customField = $this->callAPISuccess('custom_field', 'create', $fieldParams);
$exporter = new CRM_Utils_Migrate_Export();
$customGroup = $this->customGroupCreate($customGroupParams);
$fieldParams['custom_group_id'] = $customGroup['id'];
$customField = $this->callAPISuccess('custom_field', 'create', $fieldParams);
$exporter = new CRM_Utils_Migrate_Export();
// print $exporter->toXML();
$this->assertEquals(file_get_contents($expectedXmlFilePath), $exporter->toXML());
// print $exporter->toXML();
$this->assertEquals(file_get_contents($expectedXmlFilePath), $exporter->toXML());
- $this->callAPISuccess('custom_field', 'delete', array('id' => $customField['id']));
- $this->callAPISuccess('custom_group', 'delete', array('id' => $customGroup['id']));
+ $this->callAPISuccess('custom_field', 'delete', ['id' => $customField['id']]);
+ $this->callAPISuccess('custom_group', 'delete', ['id' => $customGroup['id']]);
* @dataProvider basicXmlTestCases
*/
public function testBasicXMLImports($expectCustomGroup, $expectCustomField, $inputXmlFilePath) {
* @dataProvider basicXmlTestCases
*/
public function testBasicXMLImports($expectCustomGroup, $expectCustomField, $inputXmlFilePath) {
- $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', array(
- 1 => array($expectCustomGroup['title'], 'String'),
- ));
+ $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_custom_group WHERE title = %1', [
+ 1 => [$expectCustomGroup['title'], 'String'],
+ ]);
- $customGroups = $this->callAPISuccess('custom_group', 'get', array('title' => $expectCustomGroup['title']));
+ $customGroups = $this->callAPISuccess('custom_group', 'get', ['title' => $expectCustomGroup['title']]);
$this->assertEquals(1, $customGroups['count']);
$customGroup = array_shift($customGroups['values']);
foreach ($expectCustomGroup as $expectKey => $expectValue) {
$this->assertEquals($expectValue, $customGroup[$expectKey]);
}
$this->assertEquals(1, $customGroups['count']);
$customGroup = array_shift($customGroups['values']);
foreach ($expectCustomGroup as $expectKey => $expectValue) {
$this->assertEquals($expectValue, $customGroup[$expectKey]);
}
- $customFields = $this->callAPISuccess('custom_field', 'get', array('label' => $expectCustomField['label']));
+ $customFields = $this->callAPISuccess('custom_field', 'get', ['label' => $expectCustomField['label']]);
$this->assertEquals(1, $customFields['count']);
$customField = array_shift($customFields['values']);
foreach ($expectCustomField as $expectKey => $expectValue) {
$this->assertEquals(1, $customFields['count']);
$customField = array_shift($customFields['values']);
foreach ($expectCustomField as $expectKey => $expectValue) {