示例#1
0
 /**
  * @testdox Allows to set the role name of a user
  * @covers Auth\Entity\AuthSession::setModificationDate
  * @covers Auth\Entity\AuthSession::getModificationDate
  * @dataProvider provideModificationDateTestData
  */
 public function testSetGetModificationDate($date, $expectedDate)
 {
     $this->target->setModificationDate($date);
     if (null == $date) {
         $this->assertInstanceOf("\\DateTime", $this->target->getModificationDate());
     } else {
         $this->assertEquals($expectedDate, $this->target->getModificationDate());
     }
 }
示例#2
0
文件: User.php 项目: webpants/YAWIK
 /**
  * @param $key
  * @param $sessionParameter
  * @return $this
  */
 public function updateAuthSession($key, $sessionParameter)
 {
     $notExists = true;
     foreach ($this->authSessions as $authSession) {
         /* @var $authSession AuthSession */
         if ($key == $authSession->getName()) {
             $authSession->setSession($sessionParameter);
             $notExists = false;
         }
     }
     if ($notExists) {
         $authSession = new AuthSession();
         $authSession->setName($key);
         $authSession->setSession($sessionParameter);
         $this->authSessions[] = $authSession;
     }
     return $this;
 }