Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / entity_browser / modules / entity_form / tests / src / FunctionalJavascript / EntityFormWidgetTest.php
index aef8ebb349152a68f38eca7fdd651411fd957520..75913914f0b7889c326fcf5ac11f2dcc222bec2f 100644 (file)
@@ -75,6 +75,7 @@ class EntityFormWidgetTest extends JavascriptTestBase {
     $account = $this->drupalCreateUser([
       'access entity_browser_test_entity_form entity browser pages',
       'create foo content',
+      'create article content',
       'access content',
     ]);
     $this->drupalLogin($account);
@@ -148,6 +149,16 @@ class EntityFormWidgetTest extends JavascriptTestBase {
     $parent_node = current($parent_node);
     $this->assertEquals(1, $parent_node->get('field_reference')->count(), 'There is one child node.');
     $this->assertEquals('War is peace', $parent_node->field_reference->entity->label(), 'Child node has correct title.');
+
+    // Make sure entity create access is respected.
+    $account = $this->drupalCreateUser([
+      'access entity_browser_test_entity_form entity browser pages',
+      'create foo content',
+      'access content',
+    ]);
+    $this->drupalLogin($account);
+    $this->drupalGet('entity-browser/iframe/entity_browser_test_entity_form');
+    $this->assertSession()->pageTextContains('No widgets are available.');
   }
 
 }