/** * @covers ::setLabel * @covers ::label */ public function testLabel() { $entity_type = $this->getMock(ConfigEntityTypeInterface::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()); }