You are here

public function LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleTranslationProjectsTest.php \Drupal\locale\Tests\LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects()

Tests locale_translation_clear_cache_projects().

File

core/modules/locale/src/Tests/LocaleTranslationProjectsTest.php, line 53
Contains \Drupal\locale\Tests\LocaleTranslationProjectsTest.

Class

LocaleTranslationProjectsTest
Tests locale translation project handling.

Namespace

Drupal\locale\Tests

Code

public function testLocaleTranslationClearCacheProjects() {
  $this->moduleHandler
    ->loadInclude('locale', 'inc', 'locale.translation');
  $expected = [];
  $this
    ->assertIdentical($expected, locale_translation_get_projects());
  $this->projectStorage
    ->set('foo', []);
  $expected['foo'] = new \stdClass();
  $this
    ->assertEqual($expected, locale_translation_get_projects());
  $this->projectStorage
    ->set('bar', []);
  locale_translation_clear_cache_projects();
  $expected['bar'] = new \stdClass();
  $this
    ->assertEqual($expected, locale_translation_get_projects());
}