コード例 #1
0
 /**
  * @covers ::label
  * @covers ::setLabel
  */
 function testLabel()
 {
     $entity_type = $this->getMock(EntityTypeInterface::class);
     $entity_type->expects($this->atLeastOnce())->method('getKey')->with('label')->willReturn('label');
     $this->entityManager->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());
 }