You are here

protected function LingotekUnitTest::setUp in Lingotek Translation 8.2

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

Overrides UnitTestCase::setUp

File

tests/src/Unit/LingotekUnitTest.php, line 69

Class

LingotekUnitTest
@coversDefaultClass \Drupal\lingotek\Lingotek @group lingotek @preserveGlobalState disabled

Namespace

Drupal\Tests\lingotek\Unit

Code

protected function setUp() {
  $this->api = $this
    ->createMock(LingotekApiInterface::class);
  $this->languageLocaleMapper = $this
    ->createMock(LanguageLocaleMapperInterface::class);
  $this->config = $this
    ->getMockBuilder(Config::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->configEditable = $this
    ->getMockBuilder(Config::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->lingotekFilterManager = $this
    ->createMock(LingotekFilterManagerInterface::class);
  $this->configFactory = $this
    ->createMock(ConfigFactoryInterface::class);
  $this->configFactory
    ->expects($this
    ->any())
    ->method('get')
    ->with('lingotek.settings')
    ->will($this
    ->returnValue($this->config));
  $this->configFactory
    ->expects($this
    ->any())
    ->method('getEditable')
    ->with('lingotek.settings')
    ->will($this
    ->returnValue($this->configEditable));
  $this->lingotek = new Lingotek($this->api, $this->languageLocaleMapper, $this->configFactory, $this->lingotekFilterManager);
}