You are here

public function PaymentStatusTest::testLabel in Payment 8.2

@covers ::setLabel @covers ::label

File

tests/src/Unit/Entity/PaymentStatusTest.php, line 78

Class

PaymentStatusTest
@coversDefaultClass \Drupal\payment\Entity\PaymentStatus

Namespace

Drupal\Tests\payment\Unit\Entity

Code

public function testLabel() {
  $entity_type = $this
    ->createMock(ConfigEntityTypeInterface::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());
}