You are here

protected function EntityBrowserTest::deleteTests in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/Extension/EntityBrowserTest.php \Drupal\Tests\entity_browser\Kernel\Extension\EntityBrowserTest::deleteTests()

Tests the deleting of entity browser.

1 call to EntityBrowserTest::deleteTests()
EntityBrowserTest::testEntityBrowserCrud in tests/src/Kernel/Extension/EntityBrowserTest.php
Tests CRUD operations.

File

tests/src/Kernel/Extension/EntityBrowserTest.php, line 228

Class

EntityBrowserTest
Tests the entity_browser config entity.

Namespace

Drupal\Tests\entity_browser\Kernel\Extension

Code

protected function deleteTests() {
  $entity = $this->controller
    ->load('test_browser');

  // Ensure that the storage isn't currently empty.
  $config_storage = $this->container
    ->get('config.storage');
  $config = $config_storage
    ->listAll('entity_browser.browser.');
  $this
    ->assertFalse(empty($config), 'There are entity browsers in config storage.');

  // Delete the entity browser.
  $entity
    ->delete();

  // Ensure that the storage is now empty.
  $config = $config_storage
    ->listAll('entity_browser.browser.');
  $this
    ->assertTrue(empty($config), 'There are no entity browsers in config storage.');
}