class MediaInstallTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/media/tests/src/Functional/MediaInstallTest.php \Drupal\Tests\media\Functional\MediaInstallTest
- 9 core/modules/media/tests/src/Functional/MediaInstallTest.php \Drupal\Tests\media\Functional\MediaInstallTest
Tests media Install / Uninstall logic.
@group media
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\media\Functional\MediaInstallTest
Expanded class hierarchy of MediaInstallTest
File
- core/
modules/ media/ tests/ src/ Functional/ MediaInstallTest.php, line 12
Namespace
Drupal\Tests\media\FunctionalView source
class MediaInstallTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'media',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this
->drupalLogin($this
->drupalCreateUser([
'administer modules',
]));
}
/**
* Tests reinstalling after being uninstalled.
*/
public function testReinstallAfterUninstall() {
$page = $this
->getSession()
->getPage();
$assert_session = $this
->assertSession();
// Uninstall the media module.
$this->container
->get('module_installer')
->uninstall([
'media',
], FALSE);
$this
->drupalGet('/admin/modules');
$page
->checkField('modules[media][enable]');
$page
->pressButton('Install');
$assert_session
->pageTextNotContains('could not be moved/copied because a file by that name already exists in the destination directory');
$assert_session
->pageTextContains('Module Media has been enabled');
}
}