/** * @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; }
/** * @testdox Allows to set the name of the session * @covers Auth\Entity\AuthSession::getName * @covers Auth\Entity\AuthSession::setName */ public function testSetGetName() { $input = 'YawikSession'; $this->target->setName($input); $this->assertEquals($input, $this->target->getName()); }