LayoutBuilderIntegrationTest.php in Lightning Layout 8.2
File
tests/src/Functional/LayoutBuilderIntegrationTest.php
View source
<?php
namespace Drupal\Tests\lightning_layout\Functional;
use Drupal\Tests\BrowserTestBase;
class LayoutBuilderIntegrationTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'block',
'lightning_landing_page',
'lightning_page',
'lightning_roles',
];
protected function setUp() {
parent::setUp();
$this
->drupalPlaceBlock('local_tasks_block');
}
public function testLayoutBuilderIntegration() {
$assert_session = $this
->assertSession();
$page = $this
->getSession()
->getPage();
$account = $this
->drupalCreateUser();
$account
->addRole('landing_page_creator');
$account
->addRole('page_creator');
$account
->save();
$this
->drupalLogin($account);
$node = $this
->drupalCreateNode([
'type' => 'landing_page',
]);
$this
->drupalGet($node
->toUrl());
$assert_session
->elementExists('named', [
'link',
'Layout',
]);
$this
->drupalGet('/node/add/page');
$page
->fillField('Title', "Aesop's Fables");
$page
->fillField('Body', 'Misery loves company.');
$page
->selectFieldOption('Layout', 'Two-column');
$page
->pressButton('Save');
$assert_session
->elementExists('css', '.layout--twocol-section');
}
}