You are here

function EntityTranslationCommentTestCase::configureComments in Entity Translation 7

Enable comments and comment filtering by language.

2 calls to EntityTranslationCommentTestCase::configureComments()
EntityTranslationCommentTestCase::setUp in tests/entity_translation.test
Sets up a Drupal site for running functional and integration tests.
EntityTranslationCommentTestCase::testCommentLanguageFiltering in tests/entity_translation.test
Test comment filtering by language.

File

tests/entity_translation.test, line 418
Tests for Entity translation module.

Class

EntityTranslationCommentTestCase
Basic tests for comment related things.

Code

function configureComments($filter_by_language = TRUE) {
  $edit = array();
  $edit['comment'] = COMMENT_NODE_OPEN;
  $edit['entity_translation_comment_filter'] = $filter_by_language;
  $this
    ->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
  $this
    ->assertRaw(t('The content type %type has been updated.', array(
    '%type' => 'Basic page',
  )));
  $this
    ->drupalGet('admin/structure/types/manage/page');
  if ($filter_by_language) {
    $this
      ->assertFieldChecked('edit-entity-translation-comment-filter', 'Comment filtering is enabled.');
  }
  else {
    $this
      ->assertNoFieldChecked('edit-entity-translation-comment-filter', 'Comment filtering is disabled.');
  }
}