You are here

protected function StemmerTest::setUp in Snowball Stemmer 8

Same name in this branch
  1. 8 tests/src/Unit/StemmerTest.php \Drupal\Tests\snowball_stemmer\Unit\StemmerTest::setUp()
  2. 8 tests/src/Unit/Plugin/Processor/StemmerTest.php \Drupal\Tests\snowball_stemmer\Unit\Plugin\Processor\StemmerTest::setUp()
Same name and namespace in other branches
  1. 2.x tests/src/Unit/Plugin/Processor/StemmerTest.php \Drupal\Tests\snowball_stemmer\Unit\Plugin\Processor\StemmerTest::setUp()

Creates a new processor object for use in the tests.

Overrides UnitTestCase::setUp

File

tests/src/Unit/Plugin/Processor/StemmerTest.php, line 38

Class

StemmerTest
Tests the "Stemmer" processor.

Namespace

Drupal\Tests\snowball_stemmer\Unit\Plugin\Processor

Code

protected function setUp() {
  parent::setUp();
  $this
    ->setUpMockContainer();
  $this->stemmerService = $this
    ->getMockBuilder('Drupal\\snowball_stemmer\\Stemmer')
    ->disableOriginalConstructor()
    ->getMock();
  $this->container
    ->set('snowball_stemmer.stemmer', $this->stemmerService);
  $this->languageManager = $this
    ->createMock(LanguageManagerInterface::class);
  $this->container
    ->set('language_manager', $this->languageManager);
  \Drupal::setContainer($this->container);
  $this->processor = new SnowballStemmer([], 'string', []);
}