function CurrencyTest::testLabel in Currency 8.3
@covers ::label @covers ::setLabel
File
- tests/
src/ Unit/ Entity/ CurrencyTest.php, line 228
Class
- CurrencyTest
- @coversDefaultClass \Drupal\currency\Entity\Currency
Namespace
Drupal\Tests\currency\Unit\EntityCode
function testLabel() {
$entity_type = $this
->createMock(EntityTypeInterface::class);
$entity_type
->expects($this
->atLeastOnce())
->method('getKey')
->with('label')
->willReturn('label');
$this->entityTypeManager
->expects($this
->atLeastOnce())
->method('getDefinition')
->with($this->entityTypeId)
->willReturn($entity_type);
$label = $this
->randomMachineName();
$this
->assertSame($this->sut, $this->sut
->setLabel($label));
$this
->assertSame($label, $this->sut
->label());
}