Psecio\PropAuth\EnforcerTest::testAllowsSubjectValid PHP Метод

testAllowsSubjectValid() публичный Метод

Test that a subject is correctly allowed when the policy matches on "allows" call
    public function testAllowsSubjectValid()
    {
        $policy = Policy::instance()->hasUsername('ccornutt');
        $policySet = PolicySet::instance()->add('policy1', $policy);
        $subject = new Subject((object) ['username' => 'ccornutt']);
        $en = new Enforcer($policySet);
        $this->assertTrue($en->allows('policy1', $subject));
    }