You are here

function SecurePagesTestCase::_testMatch in Secure Pages 6

Same name and namespace in other branches
  1. 8 securepages.test \SecurePagesTestCase::_testMatch()
  2. 6.2 securepages.test \SecurePagesTestCase::_testMatch()
  3. 7 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 61
Provides SimpleTests for Secure Pages module.

Class

SecurePagesTestCase
@file Provides SimpleTests for Secure Pages module.

Code

function _testMatch() {
  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') == securepages_is_secure() ? 1 : 0, 'autocomplete path is ignored.');
}