You are here

protected function LingotekDashboardControllerTest::setUpConfigurableLanguageMock in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 8 tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  2. 4.0.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  3. 3.0.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  4. 3.1.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  5. 3.2.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  6. 3.3.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  7. 3.4.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  8. 3.5.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  9. 3.6.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  10. 3.7.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
  11. 3.8.x tests/src/Unit/Controller/LingotekDashboardControllerTest.php \Drupal\Tests\lingotek\Unit\Controller\LingotekDashboardControllerTest::setUpConfigurableLanguageMock()

Setup the entity type manager for returning configurable language storage and its mocks.

2 calls to LingotekDashboardControllerTest::setUpConfigurableLanguageMock()
LingotekDashboardControllerTest::testNodeTypesEnabledForLingotekTranslation in tests/src/Unit/Controller/LingotekDashboardControllerTest.php
Tests that when the node entity type is enabled, the response contains the stats of nodes.
LingotekDashboardControllerTest::testNoTypesEnabledForLingotekTranslation in tests/src/Unit/Controller/LingotekDashboardControllerTest.php
Tests that when no type is enabled, no types are included in the stats.

File

tests/src/Unit/Controller/LingotekDashboardControllerTest.php, line 243

Class

LingotekDashboardControllerTest
@coversDefaultClass \Drupal\lingotek\Controller\LingotekDashboardController @group lingotek @preserveGlobalState disabled

Namespace

Drupal\Tests\lingotek\Unit\Controller

Code

protected function setUpConfigurableLanguageMock() {
  $language = $this
    ->createMock(ConfigurableLanguageInterface::class);
  $this->entityStorage = $this
    ->createMock(EntityStorageInterface::class);
  $this->entityStorage
    ->expects($this
    ->any())
    ->method('load')
    ->willReturn($language);
  $this->entityTypeManager
    ->expects($this
    ->any())
    ->method('getStorage')
    ->willReturn($this->entityStorage);
}