Пример #1
0
 /**
  * Clear the authorization state of a given service
  *
  * @param string $service
  *
  * @return TokenStorageInterface
  */
 public function clearAuthorizationState($service)
 {
     $service = $this->normalizeServiceName($service);
     $states = $this->sessionScope->get(self::SESSION_STATE);
     if (array_key_exists($service, $states)) {
         unset($states, $service);
     }
     $this->sessionScope->set(self::SESSION_STATE, $states);
     return $this;
 }
Пример #2
0
 public function testScopeGetterSetter()
 {
     $scope2 = new Session\Scope('test2');
     $scope2->nextTest = 'nextValue';
     $this->assertEquals('nextValue', $scope2->nextTest);
     $this->assertEquals('nextValue', $scope2->get('nextTest'));
     $this->assertTrue($scope2->has('nextTest'));
     $this->assertTrue(isset($scope2->nextTest));
     $scope2->set('nextTest2', 'nextValue2');
     $this->assertEquals('nextValue2', $scope2->nextTest2);
     $scope2->remove('nextTest2');
     $this->assertNull($scope2->nextTest2);
     $scope2->nextTest3 = 'nextTest3';
     unset($scope2->nextTest3);
     $this->assertNull($scope2->nextTest3);
 }