You are here

protected function LingotekUnitTest::setUp in Lingotek Translation 8

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

Class

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

Namespace

Drupal\Tests\lingotek\Unit

Code

protected function setUp() {
  $this->api = $this
    ->getMock('\\Drupal\\lingotek\\Remote\\LingotekApiInterface');
  $this->languageLocaleMapper = $this
    ->getMock('Drupal\\lingotek\\LanguageLocaleMapperInterface');
  $this->config = $this
    ->getMockBuilder('\\Drupal\\Core\\Config\\Config')
    ->disableOriginalConstructor()
    ->getMock();
  $config_factory = $this
    ->getMock('\\Drupal\\Core\\Config\\ConfigFactoryInterface');
  $config_factory
    ->expects($this
    ->once())
    ->method('getEditable')
    ->with('lingotek.settings')
    ->will($this
    ->returnValue($this->config));
  $this->lingotek = new Lingotek($this->api, $this->languageLocaleMapper, $config_factory);
}