You are here

protected function RedirectRequestSubscriberTest::getLanguageManagerStub in Redirect 8

Gets the language manager mock object.

Return value

\Drupal\language\ConfigurableLanguageManagerInterface|PHPUnit_Framework_MockObject_MockObject

1 call to RedirectRequestSubscriberTest::getLanguageManagerStub()
RedirectRequestSubscriberTest::callOnKernelRequestCheckRedirect in tests/src/Unit/RedirectRequestSubscriberTest.php
Instantiates the subscriber and runs onKernelRequestCheckRedirect()

File

tests/src/Unit/RedirectRequestSubscriberTest.php, line 291

Class

RedirectRequestSubscriberTest
Tests the redirect logic.

Namespace

Drupal\Tests\redirect\Unit

Code

protected function getLanguageManagerStub() {
  $language_manager = $this
    ->getMockBuilder('Drupal\\language\\ConfigurableLanguageManagerInterface')
    ->getMock();
  $language_manager
    ->expects($this
    ->any())
    ->method('getCurrentLanguage')
    ->will($this
    ->returnValue(new Language([
    'id' => 'en',
  ])));
  return $language_manager;
}