You are here

function FFCTestCase::CoreTestHideSourceTargetNotEmpty in Field formatter conditions 7

Test Hide source when target is not empty condition on Core.

1 call to FFCTestCase::CoreTestHideSourceTargetNotEmpty()
FFCTestCase::testVannillaCore in tests/ffc.test
Test Vannilla Core.

File

tests/ffc.test, line 176
Test file for Field formatter conditions.

Class

FFCTestCase
Group UI tests.

Code

function CoreTestHideSourceTargetNotEmpty() {

  // Hide body when tags are not empty.
  $condition = array(
    'fields[body][settings_edit_form][settings][conditions][0][condition]' => 'hide_not_empty',
  );
  $configuration = array(
    'fields[body][settings_edit_form][settings][conditions][0][configuration][target]' => 'field_tags',
  );
  $this
    ->ffcEditFormatterSettings($condition, $configuration);
  $this
    ->drupalGet('node/' . $this->node1->nid);
  $this
    ->assertNoText($this->node1->body[$this->node1->language][0]['value']);
  $this
    ->assertText($this->terms[0]);
  $this
    ->assertText($this->terms[1]);
  $this
    ->assertText($this->terms[2]);

  // Empty tags.
  $edit = array(
    'field_tags[und]' => '',
  );
  $this
    ->drupalPost('node/' . $this->node1->nid . '/edit', $edit, t('Save'));
  $this
    ->assertText($this->node1->body[$this->node1->language][0]['value']);
  $this
    ->assertNoText($this->terms[0]);
  $this
    ->assertNoText($this->terms[1]);
  $this
    ->assertNoText($this->terms[2]);
}