ComponentValidationTest.php
1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace Drupal\Tests\drupal_cms_ai\Functional;
use Drupal\FunctionalTests\Core\Recipe\RecipeTestTrait;
use Drupal\Tests\BrowserTestBase;
/**
* @group drupal_cms_ai
*/
class ComponentValidationTest extends BrowserTestBase {
use RecipeTestTrait;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
public function test(): void {
// The recipe block config requires an admin theme to be set.
$this->config('system.theme')->set('admin', $this->defaultTheme)->save();
$dir = realpath(__DIR__ . '/../../..');
// The recipe should apply cleanly.
$this->applyRecipe($dir);
// Apply it again to prove that it is idempotent.
$this->applyRecipe($dir);
// The privacy settings should be available to anonymous users.
$this->drupalPlaceBlock('system_menu_block:footer', ['label' => 'Footer']);
$this->drupalGet('<front>');
$footer_menu = $this->assertSession()
->elementExists('css', 'nav > h2:contains("Footer") + ul');
$this->assertTrue($footer_menu->hasLink('My privacy settings'));
}
}