function CurrencyLocaleListBuilderTest::testCreateInstance in Currency 8.3
@covers ::createInstance @covers ::__construct
File
- tests/
src/ Unit/ Entity/ CurrencyLocale/ CurrencyLocaleListBuilderTest.php, line 76
Class
- CurrencyLocaleListBuilderTest
- @coversDefaultClass \Drupal\currency\Entity\CurrencyLocale\CurrencyLocaleListBuilder
Namespace
Drupal\Tests\currency\Unit\Entity\CurrencyLocaleCode
function testCreateInstance() {
$this->entityType
->expects($this
->any())
->method('id')
->willReturn('currency');
$entity_type_manager = $this
->createMock(EntityTypeManagerInterface::class);
$entity_type_manager
->expects($this
->once())
->method('getStorage')
->with('currency')
->willReturn($this->entityStorage);
$container = $this
->createMock(ContainerInterface::class);
$map = array(
array(
'entity_type.manager',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$entity_type_manager,
),
array(
'module_handler',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->moduleHandler,
),
array(
'string_translation',
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE,
$this->stringTranslation,
),
);
$container
->expects($this
->any())
->method('get')
->willReturnMap($map);
$sut = CurrencyLocaleListBuilder::createInstance($container, $this->entityType);
$this
->assertInstanceOf(CurrencyLocaleListBuilder::class, $sut);
}