public function testGetMappableAttributeIndicesAndDerivedTypes()
 {
     $data = ImportModelTestItemImportRules::getMappableAttributeIndicesAndDerivedTypes();
     $compareData = array('boolean' => 'Boolean', 'createdByUser' => 'Created By User', 'createdDateTime' => 'Created Date Time', 'currencyValue' => 'Currency Value', 'date' => 'Date', 'dateTime' => 'Date Time', 'decimal' => 'Decimal', 'dropDown' => 'Drop Down', 'firstName' => 'First Name', 'float' => 'Float', 'FullName' => 'Full Name', 'hasOne' => 'Has One', 'hasOneAlso' => 'Has One Also', 'id' => 'Id', 'ImportModelTestItem3Derived' => 'ImportModelTestItem3', 'integer' => 'Integer', 'lastName' => 'Last Name', 'modifiedByUser' => 'Modified By User', 'modifiedDateTime' => 'Modified Date Time', 'multiDropDown' => 'Multi Drop Down', 'numerical' => 'Numerical', 'owner' => 'Owner', 'phone' => 'Phone', 'primaryAddress__city' => 'Primary Address - City', 'primaryAddress__country' => 'Primary Address - Country', 'primaryAddress__invalid' => 'Primary Address - Invalid', 'primaryAddress__latitude' => 'Primary Address - Latitude', 'primaryAddress__longitude' => 'Primary Address - Longitude', 'primaryAddress__postalCode' => 'Primary Address - Postal Code', 'primaryAddress__state' => 'Primary Address - State', 'primaryAddress__street1' => 'Primary Address - Street 1', 'primaryAddress__street2' => 'Primary Address - Street 2', 'primaryEmail__emailAddress' => 'Primary Email - Email Address', 'primaryEmail__isInvalid' => 'Primary Email - Is Invalid', 'primaryEmail__optOut' => 'Primary Email - Opt Out', 'radioDropDown' => 'Radio Drop Down', 'secondaryEmail__emailAddress' => 'Secondary Email - Email Address', 'secondaryEmail__isInvalid' => 'Secondary Email - Is Invalid', 'secondaryEmail__optOut' => 'Secondary Email - Opt Out', 'string' => 'String', 'tagCloud' => 'Tag Cloud', 'textArea' => 'Text Area', 'url' => 'Url');
     $this->assertEquals(serialize($compareData), serialize($data));
     $mappingFormLayoutUtil = ImportToMappingFormLayoutUtil::make('ImportModelTestItem', new ZurmoActiveForm(), 'ImportModelTestItem', $data);
     $this->assertEquals(serialize($compareData), serialize($mappingFormLayoutUtil->getMappableAttributeIndicesAndDerivedTypesForImportColumns()));
     $compareData2 = array('boolean' => 'Boolean', 'currencyValue' => 'Currency Value', 'date' => 'Date', 'dateTime' => 'Date Time', 'decimal' => 'Decimal', 'dropDown' => 'Drop Down', 'firstName' => 'First Name', 'float' => 'Float', 'FullName' => 'Full Name', 'hasOne' => 'Has One', 'hasOneAlso' => 'Has One Also', 'ImportModelTestItem3Derived' => 'ImportModelTestItem3', 'integer' => 'Integer', 'lastName' => 'Last Name', 'multiDropDown' => 'Multi Drop Down', 'numerical' => 'Numerical', 'owner' => 'Owner', 'phone' => 'Phone', 'primaryAddress__city' => 'Primary Address - City', 'primaryAddress__country' => 'Primary Address - Country', 'primaryAddress__invalid' => 'Primary Address - Invalid', 'primaryAddress__latitude' => 'Primary Address - Latitude', 'primaryAddress__longitude' => 'Primary Address - Longitude', 'primaryAddress__postalCode' => 'Primary Address - Postal Code', 'primaryAddress__state' => 'Primary Address - State', 'primaryAddress__street1' => 'Primary Address - Street 1', 'primaryAddress__street2' => 'Primary Address - Street 2', 'primaryEmail__emailAddress' => 'Primary Email - Email Address', 'primaryEmail__isInvalid' => 'Primary Email - Is Invalid', 'primaryEmail__optOut' => 'Primary Email - Opt Out', 'radioDropDown' => 'Radio Drop Down', 'secondaryEmail__emailAddress' => 'Secondary Email - Email Address', 'secondaryEmail__isInvalid' => 'Secondary Email - Is Invalid', 'secondaryEmail__optOut' => 'Secondary Email - Opt Out', 'string' => 'String', 'tagCloud' => 'Tag Cloud', 'textArea' => 'Text Area', 'url' => 'Url');
     $this->assertEquals(serialize($compareData2), serialize($mappingFormLayoutUtil->getMappableAttributeIndicesAndDerivedTypesForExtraColumns()));
 }
 public function testRenderImportColumnContent()
 {
     $super = SecurityTestHelper::createSuperAdmin();
     Yii::app()->user->userModel = $super;
     $data = ImportModelTestItemImportRules::getMappableAttributeIndicesAndDerivedTypes();
     $mappingFormLayoutUtil = ImportToMappingFormLayoutUtil::make('ImportModelTestItem', new ZurmoActiveForm(), 'ImportModelTestItem', $data);
     $sampleValue = 'a';
     $columnName = 'SampleColumnName';
     $content = $mappingFormLayoutUtil->renderImportColumnContent($columnName, $sampleValue);
     $this->assertEquals($content, '<div id="' . $columnName . '-import-data" class="column-import-data" title="' . $sampleValue . '">' . $sampleValue . '</div>');
     $sampleValue = str_repeat('a', 24);
     $content = $mappingFormLayoutUtil->renderImportColumnContent($columnName, $sampleValue);
     $this->assertEquals($content, '<div id="' . $columnName . '-import-data" class="column-import-data" title="' . $sampleValue . '">' . $sampleValue . '</div>');
 }