예제 #1
0
 /**
  * Whether level is matched.
  *
  * @param T_Auth $auth
  * @return bool
  */
 function isSatisfiedBy($auth)
 {
     return (bool) ($this->level & $auth->getLevel());
     /* bit-wise operator is used here so the constructor argument can be
        more than 1 level e.g. T_Auth::HUMAN|T_Auth::OBFUSCATED */
 }
예제 #2
0
파일: Auth.php 프로젝트: robtuley/knotwerk
 function testLevelCanBeChanged()
 {
     $auth = new T_Auth(T_Auth::HUMAN);
     $auth->setLevel(T_Auth::OBFUSCATED);
     $this->assertSame(T_Auth::OBFUSCATED, $auth->getLevel());
 }