LayoutBuilderMediaTest.php in Core Context 8
File
tests/src/Functional/LayoutBuilderMediaTest.php
View source
<?php
namespace Drupal\Tests\core_context\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\media\Traits\MediaTypeCreationTrait;
class LayoutBuilderMediaTest extends BrowserTestBase {
use MediaTypeCreationTrait;
protected static $modules = [
'core_context',
'layout_builder',
'media',
];
protected $defaultTheme = 'stark';
public function testMediaLayout() : void {
$media_type = $this
->createMediaType('image')
->id();
$this
->drupalLogin($this->rootUser);
$this
->drupalGet("/admin/structure/media/manage/{$media_type}/display");
$page = $this
->getSession()
->getPage();
$page
->checkField('Use Layout Builder');
$page
->pressButton('Save');
$page
->clickLink('Manage layout');
$this
->assertSession()
->statusCodeEquals(200);
}
}