ModerationDashboardTest.php in Moderation Dashboard 8
File
tests/src/Functional/ModerationDashboardTest.php
View source
<?php
namespace Drupal\Tests\moderation_dashboard\Functional;
class ModerationDashboardTest extends ModerationDashboardTestBase {
public $setEditorialWorkflow = FALSE;
public $testNodeTypes = [];
public function testModerationDashboardLoads() {
$this
->drupalGet('/user/' . $this->user
->id() . '/moderation/dashboard');
$this
->assertSession()
->statusCodeEquals(403);
$this
->drupalLogin($this->user);
$this
->drupalGet('/user/' . $this->user
->id() . '/moderation/dashboard');
$this
->assertSession()
->statusCodeEquals(403);
$this
->drupalCreateContentType([
'type' => 'page',
]);
$this
->drupalGet('/user/' . $this->user
->id() . '/moderation/dashboard');
$this
->assertSession()
->statusCodeEquals(403);
$this->editorialWorkflow
->getTypePlugin()
->addEntityTypeAndBundle('node', 'page');
$this->editorialWorkflow
->save();
$this
->drupalCreateNode([
'type' => 'page',
'title' => 'Test title first revision',
'moderation_state' => 'published',
]);
$this
->drupalGet('/user/' . $this->user
->id() . '/moderation/dashboard');
$this
->assertSession()
->statusCodeEquals(200);
}
}