<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Test csv import for each component.
*
- * @param string $component component name ( Event, Contribution, Membership, Activity etc)
- * @param array $headers csv data headers
- * @param array $rows csv data rows
- * @param string $contactType contact type
- * @param string $mode import mode
- * @param array $fieldMapper select mapper fields while import
- * @param array $other other parameters
+ * @param string $component
+ * Component name ( Event, Contribution, Membership, Activity etc).
+ * @param array $headers
+ * Csv data headers.
+ * @param array $rows
+ * Csv data rows.
+ * @param string $contactType
+ * Contact type.
+ * @param string $mode
+ * Import mode.
+ * @param array $fieldMapper
+ * Select mapper fields while import.
+ * @param array $other
+ * Other parameters.
* useMappingName : to reuse mapping
* dateFormat : date format of data
* checkMapperHeaders : to override default check mapper headers
* saveMapping : save current mapping?
* saveMappingName : to override mapping name
- *
*/
- function importCSVComponent($component,
+ function importCSVComponent(
+ $component,
$headers,
$rows,
$contactType = 'Individual',
- $mode = 'Skip',
+ $mode = 'Skip',
$fieldMapper = array(),
- $other = array()
+ $other = array()
) {
// Go to contact import page.
/**
* Test contact import.
*
- * @param array $headers csv data headers
- * @param array $rows csv data rows
- * @param string $contactType contact type
- * @param string $mode import mode
- * @param array $fieldMapper select mapper fields while import
- * @param array $other other parameters
+ * @param array $headers
+ * Csv data headers.
+ * @param array $rows
+ * Csv data rows.
+ * @param string $contactType
+ * Contact type.
+ * @param string $mode
+ * Import mode.
+ * @param array $fieldMapper
+ * Select mapper fields while import.
+ * @param array $other
+ * Other parameters.
* contactSubtype : import for selected Contact Subtype
* useMappingName : to reuse mapping
* selectTag : select existing tag for contacts
* callbackImportSummary : function to override default import summary assertions
*
- * @param string $type import type (csv/sql)
- * @todo:currently only supports csv, need to work on sql import
+ * @param string $type
+ * Import type (csv/sql).
+ * @todo:currently only supports csv, need to work on sql import
*/
- function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') {
+ public function importContacts($headers, $rows, $contactType = 'Individual', $mode = 'Skip', $fieldMapper = array(), $other = array(), $type = 'csv') {
// Go to contact import page.
$this->openCiviPage("import/contact", "reset=1", "uploadFile");
$this->waitForPageToLoad($this->getTimeoutMsec());
// Check confirmation alert.
- $this->assertTrue((bool)preg_match("/^Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
+ $this->assertTrue((bool) preg_match("/^Are you sure you want to Import now[\s\S]$/", $this->getConfirmation()));
$this->chooseOkOnNextConfirmation();
$this->waitForPageToLoad($this->getTimeoutMsec());
/**
* Helper function to get the import url of the component.
- * @param string $component component name
+ * @param string $component
+ * Component name.
*
- * @return string import url
+ * @return string
+ * import url
*/
private function _getImportComponentUrl($component) {
$importComponentUrl = array(
*
* @return string
*/
- function _getImportComponentContactType($component, $contactType) {
+ public function _getImportComponentContactType($component, $contactType) {
$importComponentMode = array(
'Event' => array(
'Individual' => 'CIVICRM_QFID_1_8',
* @param array $checkMapperHeaders
* @param string $headerSelector
*/
- function _checkImportMapperData($headers, $rows, $existingMapping = NULL, $checkMapperHeaders = array(), $headerSelector = 'th') {
+ public function _checkImportMapperData($headers, $rows, $existingMapping = NULL, $checkMapperHeaders = array(), $headerSelector = 'th') {
if (empty($checkMapperHeaders)) {
$checkMapperHeaders = array(
* @param array $rows
* @param string $contactType
*
- * @return array $contactIds imported contact ids
+ * @return array
+ * imported contact ids
*/
- function _getImportedContactIds($rows, $contactType = 'Individual') {
+ public function _getImportedContactIds($rows, $contactType = 'Individual') {
$contactIds = array();
foreach ($rows as $row) {
* @param array $headers
* @param array $rows
*/
- function _formatContactCSVdata(&$headers, &$rows) {
+ public function _formatContactCSVdata(&$headers, &$rows) {
if (!isset($headers['contact_relationships'])) {
return;
}
}
}
}
-