FlagBookmarkInstallUninstallTest.php in Flag 8.4
File
modules/flag_bookmark/tests/src/Kernel/FlagBookmarkInstallUninstallTest.php
View source
<?php
namespace Drupal\Tests\flag_bookmark\Kernel;
use Drupal\flag\Entity\Flag;
use Drupal\Tests\flag\Kernel\FlagKernelTestBase;
use Drupal\views\Entity\View;
class FlagBookmarkInstallUninstallTest extends FlagKernelTestBase {
public function testInstallUninstall() {
$this
->installConfig([
'system',
]);
$this
->installSchema('system', [
'key_value_expire',
]);
$this
->installSchema('user', [
'users_data',
]);
$this->container
->get('module_installer')
->install([
'flag_bookmark',
]);
$this
->doTestsOnInstall();
$this->container
->get('module_installer')
->uninstall([
'flag_bookmark',
]);
$this
->assertNull(Flag::load('bookmark'));
$this
->assertNull(View::load('flag_bookmark'));
$this->container
->get('module_installer')
->install([
'flag_bookmark',
]);
$this
->doTestsOnInstall();
}
protected function doTestsOnInstall() {
$this
->assertEquals([
'node',
'flag_bookmark',
], Flag::load('bookmark')
->getDependencies()['module']);
$this
->assertEquals([
'flag.flag.bookmark',
'system.menu.main',
], View::load('flag_bookmark')
->getDependencies()['config']);
}
}