protected function BuiltinTest::setUp in Freelinking 4.0.x
Same name and namespace in other branches
- 8.3 tests/src/Unit/Plugin/freelinking/BuiltinTest.php \Drupal\Tests\freelinking\Unit\Plugin\freelinking\BuiltinTest::setUp()
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ Plugin/ freelinking/ BuiltinTest.php, line 57
Class
- BuiltinTest
- Tests the freelinking builtin plugin.
Namespace
Drupal\Tests\freelinking\Unit\Plugin\freelinkingCode
protected function setUp() : void {
// Mock string translation service.
$tProphet = $this
->prophesize('\\Drupal\\Core\\StringTranslation\\TranslationInterface');
$tProphet
->translateString(Argument::any())
->willReturn('Redact, show text only, or display the indicator');
$this->translationInterfaceMock = $tProphet
->reveal();
$container = new ContainerBuilder();
$container
->set('string_translation', $tProphet
->reveal());
\Drupal::setContainer($container);
}