You are here

public function ScriptManagerTest::testScriptManagerConditions in Script Manager 8

Test the visibility conditions.

File

tests/src/Functional/ScriptManagerTest.php, line 67

Class

ScriptManagerTest
Test the script manager module.

Namespace

Drupal\Tests\script_manager\Functional

Code

public function testScriptManagerConditions() {
  $this->exampleScript
    ->set('visibility', [
    'request_path' => [
      'id' => 'request_path',
      'pages' => '/user/register',
      'negate' => FALSE,
      'context_mapping' => [],
    ],
  ])
    ->save();
  $this
    ->drupalGet('<front>');
  $this
    ->assertScriptNotVisible();
  $this
    ->drupalGet('user/register');
  $this
    ->assertScriptVisibile();
}