ParagraphsUninstallTest.php in Paragraphs 8
File
tests/src/Functional/ParagraphsUninstallTest.php
View source
<?php
namespace Drupal\Tests\paragraphs\Functional;
use Drupal\Tests\BrowserTestBase;
class ParagraphsUninstallTest extends BrowserTestBase {
public static $modules = array(
'paragraphs_demo',
);
protected $defaultTheme = 'stark';
public function setUp() : void {
parent::setUp();
$admin_user = $this
->drupalCreateUser(array(
'administer paragraphs types',
'administer modules',
));
$this
->drupalLogin($admin_user);
}
public function testUninstall() {
$this
->drupalGet('admin/modules/uninstall');
$this
->submitForm([
'uninstall[paragraphs_demo]' => TRUE,
], 'Uninstall');
$this
->submitForm([], 'Uninstall');
$this
->clickLink('Remove Paragraphs library items');
$this
->submitForm([], 'Delete all Paragraphs library items');
$this
->drupalGet('admin/modules/uninstall');
$this
->submitForm([
'uninstall[paragraphs_library]' => TRUE,
], 'Uninstall');
$this
->submitForm([], 'Uninstall');
$this
->clickLink('Remove Paragraphs');
$this
->submitForm([], 'Delete all Paragraphs');
$this
->drupalGet('admin/modules/uninstall');
$this
->submitForm([
'uninstall[paragraphs]' => TRUE,
], 'Uninstall');
$this
->submitForm([], 'Uninstall');
$this
->assertSession()
->pageTextContains('The selected modules have been uninstalled.');
$this
->assertSession()
->pageTextNotContains('Paragraphs demo');
$this
->assertSession()
->pageTextNotContains('Paragraphs library');
$this
->assertSession()
->pageTextNotContains('Paragraphs');
}
}