You are here

function AcquiaLiftsWebTest::testUDFMappings in Acquia Lift Connector 7.3

File

tests/acquia_lift.test, line 447
Tests for Acquia Lift Profiles module.

Class

AcquiaLiftsWebTest
Tests Acquia Lift functionality.

Code

function testUDFMappings() {
  $this
    ->configureLift();
  $this
    ->drupalLogin($this->admin_user);
  $edit = array(
    'acquia_lift_udf_mappings[person][person_udf1]' => 'taxonomy_context__tags',
    'acquia_lift_udf_mappings[touch][touch_udf20]' => 'taxonomy_context__tags',
  );
  $this
    ->drupalPost('admin/config/services/acquia_lift', $edit, $this->admin_button_text);
  $this
    ->drupalGet('node/' . $this->articles['one_tag']->nid);
  $expected_tag = $this->tags['one_tag'][0];
  $this
    ->assertLiftMetaTag('person_udf1', $expected_tag);
  $this
    ->assertLiftMetaTag('touch_udf20', $expected_tag);
  $edit = array(
    'acquia_lift_udf_mappings[person][person_udf1]' => 'taxonomy_context__tags',
    'acquia_lift_udf_mappings[touch][touch_udf20]' => '',
    'acquia_lift_udf_mappings[event][event_udf5]' => 'taxonomy_context__tags',
  );
  $this
    ->drupalPost('admin/config/services/acquia_lift', $edit, $this->admin_button_text);
  $this
    ->drupalGet('node/' . $this->articles['two_tags']->nid);
  $expected_tags = implode(',', $this->tags['two_tags']);
  $this
    ->assertLiftMetaTag('person_udf1', $expected_tags);
  $this
    ->assertNoLiftMetaTag('touch_udf20');
  $this
    ->assertLiftMetaTag('event_udf5', $expected_tags);
}