Commit 5fe56e21 authored by alexpott's avatar alexpott
Browse files

Issue #2445175 by Arla: Exception message in setNewRevision() is missing @entity_type context

parent 2a4f4d2f
......@@ -221,7 +221,7 @@ public function postCreate(EntityStorageInterface $storage) {
public function setNewRevision($value = TRUE) {
if (!$this->getEntityType()->hasKey('revision')) {
throw new \LogicException(String::format('Entity type @entity_type does support revisions.'));
throw new \LogicException(String::format('Entity type @entity_type does not support revisions.', ['@entity_type' => $this->getEntityTypeId()]));
}
if ($value && !$this->newRevision) {
......
......@@ -242,6 +242,18 @@ public function testIsNewRevision() {
$this->assertTRUE($this->entity->isNewRevision());
}
/**
* @covers ::setNewRevision
*/
public function testSetNewRevisionException() {
$this->entityType->expects($this->once())
->method('hasKey')
->with('revision')
->will($this->returnValue(FALSE));
$this->setExpectedException('LogicException', 'Entity type ' . $this->entityTypeId . ' does not support revisions.');
$this->entity->setNewRevision();
}
/**
* @covers ::isDefaultRevision
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment