You are here

public function ProfileAdminTest::testProfileDelete in Linkit 8.5

Delete a profile.

File

tests/src/Functional/ProfileAdminTest.php, line 109

Class

ProfileAdminTest
Tests creating, loading and deleting profiles.

Namespace

Drupal\Tests\linkit\Functional

Code

public function testProfileDelete() {
  $this
    ->drupalLogin($this->adminUser);

  // Create a profile.
  $profile = $this
    ->createProfile();
  $this
    ->drupalGet('/admin/config/content/linkit/manage/' . $profile
    ->id() . '/delete');
  $this
    ->assertSession()
    ->statusCodeEquals(200);

  // Delete the profile.
  $this
    ->submitForm([], 'Delete');

  // Make sure that the profile was deleted properly.
  $this
    ->assertSession()
    ->pageTextContains('The linkit profile ' . $profile
    ->label() . ' has been deleted.');
  $this
    ->drupalGet('/admin/config/content/linkit');
  $this
    ->assertSession()
    ->pageTextNotContains($profile
    ->label());
}