protected function WikiTest::setUp in Freelinking 4.0.x
Same name and namespace in other branches
- 8.3 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 40
Class
- WikiTest
- Test the freelinking wiki plugin.
Namespace
Drupal\Tests\freelinking\Unit\Plugin\freelinkingCode
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);
}