InstallTest.php in Lightning Workflow 8.3
File
tests/src/Functional/InstallTest.php
View source
<?php
namespace Drupal\Tests\lightning_workflow\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
class InstallTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'content_moderation',
];
public function testWorkflowNotExists() {
$this
->assertEmpty(Workflow::load('editorial'));
$this->container
->get('module_installer')
->install([
'lightning_workflow',
]);
$this
->assertInstanceOf(Workflow::class, Workflow::load('editorial'));
}
public function testWorkflowExists() {
Workflow::create([
'id' => 'editorial',
'label' => 'Editorial',
'type' => 'content_moderation',
])
->save();
$this->container
->get('module_installer')
->install([
'lightning_workflow',
]);
$workflow = Workflow::load('editorial');
$this
->assertFalse($workflow
->getTypePlugin()
->hasState('review'));
}
}
Classes
Name |
Description |
InstallTest |
Tests that our configuration is correctly installed in various contexts. |