public function LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects in Drupal 8
Same name and namespace in other branches
- 9 core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php \Drupal\Tests\locale\Kernel\LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects()
- 10 core/modules/locale/tests/src/Kernel/LocaleTranslationProjectsTest.php \Drupal\Tests\locale\Kernel\LocaleTranslationProjectsTest::testLocaleTranslationClearCacheProjects()
Tests locale_translation_clear_cache_projects().
File
- core/
modules/ locale/ tests/ src/ Kernel/ LocaleTranslationProjectsTest.php, line 47
Class
- LocaleTranslationProjectsTest
- Tests locale translation project handling.
Namespace
Drupal\Tests\locale\KernelCode
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());
}