You are here

public function NavigationalStructureTest::entityTypeDeleteWithMultipleBundles in Entity Construction Kit (ECK) 8

Tests entity type deletion with multiple bundles.

@test

Throws

\Behat\Mink\Exception\ResponseTextException

File

tests/src/Functional/NavigationalStructureTest.php, line 241

Class

NavigationalStructureTest
Test Entity Construction Kit's navigational structure.

Namespace

Drupal\Tests\eck\Functional

Code

public function entityTypeDeleteWithMultipleBundles() {

  // Create a randomly named bundle.
  $extra_bundle = $this
    ->createEntityBundle($this->entityTypeMachineName);
  $extra_bundle_label = $extra_bundle['name'];
  $route = 'entity.eck_entity_type.delete_form';
  $routeArguments = [
    'eck_entity_type' => $this->entityTypeMachineName,
  ];
  $expectedUrl = "admin/structure/eck/{$this->entityTypeMachineName}/delete";
  $expectedTitle = "Are you sure you want to delete entity type {$this->entityTypeLabel}?";
  $crumbs = [
    'Structure',
    'ECK Entity Types',
    "Edit entity type",
  ];
  $this
    ->assertCorrectPageOnRoute($route, $routeArguments, $expectedUrl, $expectedTitle, $crumbs);
  $this
    ->assertSession()
    ->pageTextContains("Configuration deletions The listed configuration will be deleted.{$this->entityTypeLabel} type");
  $this
    ->assertSession()
    ->pageTextContains($extra_bundle_label);
  $this
    ->assertSession()
    ->pageTextContains($this->entityBundleLabel);
}