protected function EntityTranslationSettingsTest::assertSettings

Asserts that translatability has the expected value for the given bundle.

Parameters

string $entity_type: The entity type for which to check translatibility.

string $bundle: The bundle for which to check translatibility.

boolean $enabled: TRUE if translatibility should be enabled, FALSE otherwise.

array $edit: An array of values to submit to the entity translation settings page.

Return value

boolean TRUE if the assertion succeeded, FALSE otherwise.

1 call to EntityTranslationSettingsTest::assertSettings()
EntityTranslationSettingsTest::testSettingsUI in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php
Tests that the settings UI works as expected.

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php, line 116
Contains Drupal\translation_entity\Tests\EntityTranslationSettingsTest.

Class

EntityTranslationSettingsTest
Tests the Entity Test Translation UI.

Namespace

Drupal\translation_entity\Tests

Code

protected function assertSettings($entity_type, $bundle, $enabled, $edit) {
  $this
    ->drupalPost('admin/config/regional/content-language', $edit, t('Save'));
  $args = array(
    '@entity_type' => $entity_type,
    '@bundle' => $bundle,
    '@enabled' => $enabled ? 'enabled' : 'disabled',
  );
  $message = format_string('Translation for entity @entity_type (@bundle) is @enabled.', $args);
  entity_info_cache_clear();
  return $this
    ->assertEqual(translation_entity_enabled($entity_type, $bundle), $enabled, $message);
}