You are here

protected function LingotekManagementFormTest::setUp in Lingotek Translation 8

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/Form/LingotekManagementFormTest.php, line 106

Class

LingotekManagementFormTest
@coversDefaultClass \Drupal\lingotek\Form\LingotekManagementForm @group lingotek @preserveGlobalState disabled

Namespace

Drupal\Tests\lingotek\Unit\Form

Code

protected function setUp() {
  parent::setUp();
  $this->entityManager = $this
    ->getMock(EntityManagerInterface::class);
  $this->languageManager = $this
    ->getMock(LanguageManagerInterface::class);
  $this->entityQuery = $this
    ->getMockBuilder(QueryFactory::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->lingotek = $this
    ->getMock(LingotekInterface::class);
  $this->lingotekConfiguration = $this
    ->getMock(LingotekConfigurationServiceInterface::class);
  $this->languageLocaleMapper = $this
    ->getMock(LanguageLocaleMapperInterface::class);
  $this->contentTranslationManager = $this
    ->getMock(ContentTranslationManagerInterface::class);
  $this->contentTranslationService = $this
    ->getMock(LingotekContentTranslationServiceInterface::class);
  $this->tempStoreFactory = $this
    ->getMockBuilder(PrivateTempStoreFactory::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->state = $this
    ->getMock(StateInterface::class);
  $this->form = new LingotekManagementForm($this->entityManager, $this->languageManager, $this->entityQuery, $this->lingotek, $this->lingotekConfiguration, $this->languageLocaleMapper, $this->contentTranslationManager, $this->contentTranslationService, $this->tempStoreFactory, $this->state, 'node');
  $this->form
    ->setConfigFactory($this
    ->getConfigFactoryStub([
    'lingotek.settings' => [
      'account' => [
        'access_token' => 'token',
        'login_id' => 'test@example.com',
      ],
    ],
  ]));
  $this->form
    ->setStringTranslation($this
    ->getStringTranslationStub());
}