$entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
$entity->expects($this->atLeastOnce())
->method('isNew')
->willReturn(TRUE);
$result = $this->twig->render('{{ entity.isNew }}', ['entity' => $entity]);
$entity = $this->getMock('Drupal\Core\Entity\EntityInterface');
$entity->expects($this->atLeastOnce())
->method('isNew')
->willReturn(TRUE);
$result = $this->twig->render('{{ entity.isNew }}', ['entity' => $entity]);