You are here

protected function ConfigUpdateUnitTestBase::getTranslationMock in Configuration Update Manager 8

Creates a mock string translation class for the test.

1 call to ConfigUpdateUnitTestBase::getTranslationMock()
ConfigDifferTest::setUp in tests/src/Unit/ConfigDifferTest.php

File

tests/src/Unit/ConfigUpdateUnitTestBase.php, line 294

Class

ConfigUpdateUnitTestBase
Base class for unit testing in Config Update Manager.

Namespace

Drupal\Tests\config_update\Unit

Code

protected function getTranslationMock() {
  $translation = $this
    ->getMockBuilder('Drupal\\Core\\StringTranslation\\TranslationInterface')
    ->getMock();
  $translation
    ->method('translateString')
    ->will($this
    ->returnCallback([
    $this,
    'mockTranslate',
  ]));
  return $translation;
}