ModeratedContentLocalTaskTest.php in Drupal 10
File
core/modules/content_moderation/tests/src/Functional/ModeratedContentLocalTaskTest.php
View source
<?php
namespace Drupal\Tests\content_moderation\Functional;
use Drupal\Tests\BrowserTestBase;
class ModeratedContentLocalTaskTest extends BrowserTestBase {
protected $adminUser;
protected static $modules = [
'block',
'content_moderation',
'node',
];
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
$this
->drupalPlaceBlock('local_tasks_block');
$this->adminUser = $this
->drupalCreateUser([
'access administration pages',
'access content overview',
'view any unpublished content',
]);
}
public function testModeratedContentLocalTask() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/content');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->linkExists('Moderated content');
$this->container
->get('module_installer')
->uninstall([
'node',
]);
$this
->drupalGet('admin/content');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->linkNotExists('Moderated content');
}
}