protected function UnitTestBase::createLanguageManagerMock in Entity Construction Kit (ECK) 8
Creates the language manager mock.
1 call to UnitTestBase::createLanguageManagerMock()
- EntityTypeBundleInfoTest::createNewTestSubject in tests/
src/ Unit/ EntityTypeBundleInfoTest.php - Creates a new test subject.
File
- tests/
src/ Unit/ UnitTestBase.php, line 164
Class
- UnitTestBase
- Base class for unit tests.
Namespace
Drupal\Tests\eck\UnitCode
protected function createLanguageManagerMock() {
$current_language_mock = $this
->getMockForAbstractClass('\\Drupal\\Core\\Language\\LanguageInterface');
$current_language_mock
->method('getId')
->willReturn('en');
$mock = $this
->getMockForAbstractClass('\\Drupal\\Core\\Language\\LanguageManagerInterface');
$mock
->method('getCurrentLanguage')
->willReturn($current_language_mock);
return $mock;
}