Пример #1
0
 /**
  *
  */
 public function __construct()
 {
     $this->sessionScope = new \Vegas\Session\Scope(self::SESSION_NAME);
     if (!$this->sessionScope->has(self::SESSION_TOKEN)) {
         $this->sessionScope->set(self::SESSION_TOKEN, array());
     }
     if (!$this->sessionScope->has(self::SESSION_STATE)) {
         $this->sessionScope->set(self::SESSION_STATE, array());
     }
 }
Пример #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);
 }