Example #1
0
 /**
  * @return Prophecy\Prophecy\ObjectProphecy
  */
 private function getFactor(Type $type, DateTime $exp = null)
 {
     switch ($type->getValue()) {
         case Type::INHERENCE:
             $name = 'InherenceFactor';
             break;
         case Type::KNOWLEDGE:
             $name = 'KnowledgeFactor';
             break;
         case Type::POSSESSION:
             $name = 'PossessionFactor';
             break;
     }
     $factor = $this->prophesize('Firehed\\Auth\\Factors\\' . $name);
     $factor->getType()->willReturn($type);
     $factor->getExpiration()->willReturn($exp);
     $factor->getSecret()->willReturn(new Secret(''));
     return $factor;
 }
Example #2
0
 public function expireFactor(FactorType $factor) : self
 {
     switch ($factor->getValue()) {
         case FactorType::INHERENCE:
             $this->ifct = null;
             $this->ifet = null;
             break;
         case FactorType::KNOWLEDGE:
             $this->kfct = null;
             $this->kfet = null;
             break;
         case FactorType::POSSESSION:
             $this->pfct = null;
             $this->pfet = null;
             break;
     }
     return $this;
 }