function RulesTestCase::testAccessCheck

Same name in other branches
  1. 7.x-2.x tests/rules.test \RulesTestCase::testAccessCheck()

Test access checks.

File

d7-tests/rules_test_case.test, line 701

Class

RulesTestCase

Code

function testAccessCheck() {
    $rule = rule();
    // Try to set a property which is provided by the test module and is not
    // accessible, so the access check has to return FALSE.
    $rule->action('data_set', array(
        'data:select' => 'site:no-access-user',
        'value' => 'foo',
    ));
    $this->assertTrue($rule->access() === FALSE, 'Access check is working.');
}