function RulesTestCase::testAccessCheck

Same name in other branches
  1. 8.x-3.x d7-tests/rules_test_case.test \RulesTestCase::testAccessCheck()

Tests access checks.

File

tests/rules.test, line 742

Class

RulesTestCase
Rules test cases.

Code

public 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.');
}