diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index cf74af5..905ac98 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -50,16 +50,18 @@ public function testCreatingConflictingEntities() { $entity->save(); // Create an entity with the same ID, but a different label. + $exception = FALSE; try { $entity = entity_create('config_test', array('id' => 'foo', 'label' => 'Bananas')); $entity->save(); } catch (EntityMalformedException $e) { - $this->pass('A conflicting entity was not saved.'); + $exception = TRUE; } // Creating an entity with the same machine name should not succeed. $this->assertEqual($entity->label(), 'Foo', 'The entity label was not overwritten.'); $this->assertEqual($entity->style, 'foo', 'The entity style was not overwritten.'); + $this->assertTrue($exception, 'An exception was thrown when creating an entity with a duplicate ID.'); } }