function AcquiaLiftsWebTest::testFieldMappings in Acquia Lift Connector 7.3
File
- tests/
acquia_lift.test, line 411 - Tests for Acquia Lift Profiles module.
Class
- AcquiaLiftsWebTest
- Tests Acquia Lift functionality.
Code
function testFieldMappings() {
$submit_button_text = $this->admin_button_text;
$this
->configureLift();
$this
->drupalLogin($this->admin_user);
$edit = array(
'acquia_lift_field_mappings[content_section]' => 'taxonomy_context__tags',
'acquia_lift_field_mappings[content_keywords]' => 'taxonomy_context__tags',
'acquia_lift_field_mappings[persona]' => 'taxonomy_context__tags',
);
$this
->drupalPost('admin/config/services/acquia_lift', $edit, $submit_button_text);
$this
->drupalGet('node/' . $this->articles['one_tag']->nid);
$expected_tag = $this->tags['one_tag'][0];
$this
->assertLiftMetaTag('content_section', $expected_tag);
$this
->assertLiftMetaTag('content_keywords', $expected_tag);
$this
->assertLiftMetaTag('persona', $expected_tag);
$this
->drupalGet('node/' . $this->articles['two_tags']->nid);
$expected_tags = implode(',', $this->tags['two_tags']);
$this
->assertLiftMetaTag('content_section', $expected_tags);
$this
->assertLiftMetaTag('content_keywords', $expected_tags);
$this
->assertLiftMetaTag('persona', $expected_tags);
$edit = array(
'acquia_lift_field_mappings[content_section]' => 'taxonomy_context__tags',
'acquia_lift_field_mappings[content_keywords]' => '',
'acquia_lift_field_mappings[persona]' => 'taxonomy_context__tags',
);
$this
->drupalPost('admin/config/services/acquia_lift', $edit, $submit_button_text);
$this
->drupalGet('node/' . $this->articles['one_tag']->nid);
$expected_tag = $this->tags['one_tag'][0];
$this
->assertLiftMetaTag('content_section', $expected_tag);
$this
->assertNoLiftMetaTag('content_keywords');
$this
->assertLiftMetaTag('persona', $expected_tag);
}