You are here

protected function WikiTest::setUp in Freelinking 8.3

Same name and namespace in other branches
  1. 4.0.x tests/src/Unit/Plugin/freelinking/WikiTest.php \Drupal\Tests\freelinking\Unit\Plugin\freelinking\WikiTest::setUp()

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/freelinking/WikiTest.php, line 37

Class

WikiTest
Test the freelinking wiki plugin.

Namespace

Drupal\Tests\freelinking\Unit\Plugin\freelinking

Code

protected function setUp() {

  // Mock the translation interface.
  $tProphet = $this
    ->prophesize('\\Drupal\\Core\\StringTranslation\\TranslationInterface');
  $tProphet
    ->translateString(Argument::any())
    ->willReturn('Click to view a wiki page.');
  $this->translationInterfaceMock = $tProphet
    ->reveal();
  $this->container = new ContainerBuilder();
  $this->container
    ->set('string_translation', $this->translationInterfaceMock);
  \Drupal::setContainer($this->container);
}