// Create a language negotiator stub.
$negotiator =
$this->
getMockBuilder('Drupal\language\LanguageNegotiatorInterface'
) ->
getMock();
$negotiator->
expects($this->
any()) ->
method('getNegotiationMethods'
) ->
willReturn([ LanguageNegotiationUrl::METHOD_ID =>
[ 'class' => 'Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl',
'weight' => 9,
],
]);
$method =
new LanguageNegotiationUrl();
$method->
setConfig($config_factory_stub);
$method->
setLanguageManager($this->languageManager
);
$negotiator->
expects($this->
any()) ->
method('getNegotiationMethodInstance'
) ->
willReturn($method);
// Create a user stub.
$current_user =
$this->
getMockBuilder('Drupal\Core\Session\AccountInterface'
) ->
getMock();
// Create a config event subscriber stub.