1

I am extending Drupal\Tests\BrowserTestBase to create a functional test which attempts to edit and save a config entity.

Creating this via MyEntity::create($data)->save(); has weird effects: They are not shown on the list-builder page:

$data = $this->randomEntityData();
MyEntity::create($data)->save();
$this->drupalGet('admin/structure/my-entity');
$this->assertSession()->pageTextContains('There is no Entity yet.'); // OK

But they can be edited by navigating to the edit form directly (which still leaves them unlisted in the list-builder.

$this->drupalGet("admin/structure/my-entity/{$data['id']}/edit");
$this->drupalPost(NULL, $data, 'Save');
$this->assertSession()->pageTextContains("The {$data['label']} Entity was saved."); // OK
$this->assertSession()->pageTextContains('There is no Entity yet.');

Creating the entity via a form submission doesn't cause this behavior.

Does the functional test setup have some kind of cache? I'd suspect that the local and remote use different config storage, but that is impossible because the edit form wouldn't be available at all.

  • Were you ever able to resolve this? I am running in something similar right now. – Neograph734 Jul 23 '17 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.