You are here

function AcquiaLiftsWebTest::testVisibilityFiltering in Acquia Lift Connector 7.3

Test the visibility path filtering.

File

tests/acquia_lift.test, line 268
Tests for Acquia Lift Profiles module.

Class

AcquiaLiftsWebTest
Tests Acquia Lift functionality.

Code

function testVisibilityFiltering() {
  $node = $this
    ->drupalCreateNode();
  $node_url = '/node/' . $node->nid;

  // No lift when not configured.
  $this
    ->drupalGet($node_url);
  $this
    ->assertNoLift();

  // Configured without limitations
  $this
    ->configureLift();
  $this
    ->drupalGet($node_url);
  $this
    ->assertLift();

  // No node pages should have Lift
  variable_set('acquia_lift_ignore_path_patterns', '/node/*');
  $this
    ->drupalGet($node_url);
  $this
    ->assertNoLift();

  // Only the root node page should be restricted
  variable_set('acquia_lift_ignore_path_patterns', '/node');
  $this
    ->drupalGet($node_url);
  $this
    ->assertLift();

  // Multiple paths are restricted
  variable_set('acquia_lift_ignore_path_patterns', "/node\n/node/*");
  $this
    ->drupalGet($node_url);
  $this
    ->assertNoLift();
}