You are here

protected function LingotekDashboardControllerTest::setUp in Lingotek Translation 8

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

Overrides UnitTestCase::setUp

File

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

Class

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

Namespace

Drupal\Tests\lingotek\Unit\Controller

Code

protected function setUp() {
  parent::setUp();
  $this->request = $this
    ->getMock('Symfony\\Component\\HttpFoundation\\Request');
  $this->configFactory = $this
    ->getConfigFactoryStub([
    'lingotek.settings' => [
      'account' => [
        'access_token' => 'at',
        'login_id' => 'login',
      ],
    ],
  ]);
  $this->entityTypeManager = $this
    ->getMockBuilder('Drupal\\Core\\Entity\\EntityTypeManager')
    ->disableOriginalConstructor()
    ->getMock();
  $this->entityQueryFactory = $this
    ->getMockBuilder('Drupal\\Core\\Entity\\Query\\QueryFactory')
    ->disableOriginalConstructor()
    ->getMock();
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->lingotek = $this
    ->getMock('Drupal\\lingotek\\LingotekInterface');
  $this->languageLocaleMapper = $this
    ->getMock('Drupal\\lingotek\\LanguageLocaleMapperInterface');
  $this->lingotekConfiguration = $this
    ->getMock('Drupal\\lingotek\\LingotekConfigurationServiceInterface');
  $this->formBuilder = $this
    ->getMock('Drupal\\Core\\Form\\FormBuilderInterface');
  $this->logger = $this
    ->getMock('Psr\\Log\\LoggerInterface');
  $this->controller = new LingotekDashboardController($this->request, $this->configFactory, $this->entityTypeManager, $this->entityQueryFactory, $this->languageManager, $this->lingotek, $this->languageLocaleMapper, $this->lingotekConfiguration, $this->formBuilder, $this->logger);
  $this->controller
    ->setStringTranslation($this
    ->getStringTranslationStub());
}