function LocaleUpdateTest::testUpdateProjectsHidden

Check if a list of translatable projects can include hidden projects.

File

drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php, line 336
Contains Drupal\locale\Tests\LocaleUpdateTest.

Class

LocaleUpdateTest
Tests for update translations.

Namespace

Drupal\locale\Tests

Code

function testUpdateProjectsHidden() {
  module_load_include('compare.inc', 'locale');
  $config = config('locale.settings');

  // Make the test modules look like a normal custom module.
  \Drupal::state()
    ->set('locale.test_system_info_alter', TRUE);
  $this
    ->resetAll();

  // Set test condition: include disabled modules when building a project list.
  $edit = array(
    'check_disabled_modules' => TRUE,
  );
  $this
    ->drupalPost('admin/config/regional/translate/settings', $edit, t('Save configuration'));
  $projects = locale_translation_project_list();
  $this
    ->assertTrue(isset($projects['locale_test_translate']), 'Disabled module found');
  $this
    ->assertTrue(isset($projects['locale_test']), 'Enabled module found');
}