You are here

protected function LingotekManagementFormTest::setUp in Lingotek Translation 8.2

Same name and namespace in other branches
  1. 8 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 138

Class

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

Namespace

Drupal\Tests\lingotek\Unit\Form

Code

protected function setUp() {
  parent::setUp();
  $this->connection = $this
    ->getMockBuilder(Connection::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->entityTypeManager = $this
    ->createMock(EntityTypeManagerInterface::class);
  $this->entityFieldManager = $this
    ->createMock(EntityFieldManagerInterface::class);
  $this->entityTypeBundleInfo = $this
    ->createMock(EntityTypeBundleInfoInterface::class);
  $this->languageManager = $this
    ->createMock(LanguageManagerInterface::class);
  $this->lingotek = $this
    ->createMock(LingotekInterface::class);
  $this->lingotekConfiguration = $this
    ->createMock(LingotekConfigurationServiceInterface::class);
  $this->languageLocaleMapper = $this
    ->createMock(LanguageLocaleMapperInterface::class);
  $this->contentTranslationManager = $this
    ->createMock(ContentTranslationManagerInterface::class);
  $this->contentTranslationService = $this
    ->createMock(LingotekContentTranslationServiceInterface::class);
  $this->tempStoreFactory = $this
    ->getMockBuilder(PrivateTempStoreFactory::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->state = $this
    ->createMock(StateInterface::class);
  $this->moduleHandler = $this
    ->createMock(ModuleHandlerInterface::class);
  $this->linkGenerator = $this
    ->createMock(LinkGeneratorInterface::class);
  $this->form = new LingotekManagementForm($this->connection, $this->entityTypeManager, $this->languageManager, $this->lingotek, $this->lingotekConfiguration, $this->languageLocaleMapper, $this->contentTranslationManager, $this->contentTranslationService, $this->tempStoreFactory, $this->state, $this->moduleHandler, 'node', $this->entityFieldManager, $this->entityTypeBundleInfo, $this->linkGenerator);
  $this->form
    ->setConfigFactory($this
    ->getConfigFactoryStub([
    'lingotek.settings' => [
      'account' => [
        'access_token' => 'token',
        'login_id' => 'test@example.com',
      ],
    ],
  ]));
  $this->form
    ->setStringTranslation($this
    ->getStringTranslationStub());
}