diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index 32a198a..a5adf58 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -38,6 +38,30 @@ public function testStorageControllerMethods() { $expected = $info['config_prefix'] . '.'; $this->assertIdentical($controller->getConfigPrefix(), $expected); + + // Create three entities, two with the same style. + $style = $this->randomName(); + for ($i = 0; $i < 2; $i++) { + $entity = $controller->create(array( + 'id' => $this->randomName(), + 'label' => $this->randomString(), + 'style' => $style, + )); + $entity->save(); + } + $entity = $controller->create(array( + 'id' => $this->randomName(), + 'label' => $this->randomString(), + 'style' => $this->randomName(), + )); + $entity->save(); + + $entities = $controller->loadByProperties(); + $this->assertEqual(count($entities), 3, 'Three entities are loaded when no properties are specified.'); + + $entities = $controller->loadByProperties(array('style' => $style)); + $this->assertEqual(count($entities), 2, 'Two entities are loaded when the style property is specified.'); + $this->assertEqual(reset($entities)->get('style'), $style, 'The loaded entities have the style value specified.'); } }