You are here

function SecurePagesTestCase::_testMatch in Secure Pages 7

Same name and namespace in other branches
  1. 8 securepages.test \SecurePagesTestCase::_testMatch()
  2. 6.2 securepages.test \SecurePagesTestCase::_testMatch()
  3. 6 securepages.test \SecurePagesTestCase::_testMatch()

Tests the securepages_match() function.

1 call to SecurePagesTestCase::_testMatch()
SecurePagesTestCase::testSecurePages in ./securepages.test
Runs all the test functions. These are run from a single outer function to avoid multiple re-installs by simpletest.

File

./securepages.test, line 62
Provides SimpleTests for Secure Pages module.

Class

SecurePagesTestCase
@file Provides SimpleTests for Secure Pages module.

Code

function _testMatch() {
  global $is_https;
  variable_set('securepages_ignore', '*/autocomplete/*');
  $this
    ->assertTrue(securepages_match('user'), 'path user matches.');
  $this
    ->assertTrue(securepages_match('user/login'), 'path user/login matches.');
  $this
    ->assertTrue(securepages_match('admin/modules'), 'path admin/modules matches.');
  $this
    ->assertFalse(securepages_match('node'), 'path node does not match.');
  $this
    ->assertTrue(securepages_match('user/autocomplete/alice') == $is_https ? 1 : 0, 'autocomplete path is ignored.');

  // Clean up
  variable_del('securepages_ignore');
}