/** * @covers ::getString */ public function testGetString() { $entity = $this->getMock('\\Drupal\\Core\\Entity\\ContentEntityInterface'); $entity->expects($this->once())->method('label')->willReturn('foo'); $this->entityAdapter->setValue($entity); $this->assertEquals('foo', $this->entityAdapter->getString()); $this->entityAdapter->setValue(NULL); $this->assertEquals('', $this->entityAdapter->getString()); }