PhpUninstallTest.php in PHP 8
File
src/Tests/Functional/PhpUninstallTest.php
View source
<?php
namespace Drupal\Tests\php\Functional;
use Drupal\Tests\BrowserTestBase;
class PhpUninstallTest extends BrowserTestBase {
public static $modules = [
'php',
];
protected function setUp() {
parent::setUp();
$permissions = [
'access administration pages',
'administer modules',
];
$this->admin_user = $this
->drupalCreateUser($permissions);
$this
->drupalLogin($this->admin_user);
}
public function testPhpUninstall() {
$this
->drupalGet('admin/modules');
$edit = [];
$edit['uninstall[php]'] = TRUE;
$this
->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
$this
->assertText(t('Would you like to continue with uninstalling the above?'));
$this
->drupalPostForm(NULL, [], t('Uninstall'));
$this
->assertText(t('The selected modules have been uninstalled.'));
}
}