Пример #1
0
 public function testCloseCallsInternalGarbageCollectionWithGarbageCollectionMaxLifeTime()
 {
     $garbageCollectionMaxLifeTime = 50;
     $requestMock = $this->getRequestMock();
     $fileSessionHandlerMock = $this->getBlackHoleFileSessionHandler();
     $fileSessionHandlerMock->expects($this->any())->method('gc')->with($this->equalTo($garbageCollectionMaxLifeTime))->will($this->returnValue(True));
     $session = new Session($requestMock, $fileSessionHandlerMock);
     $session->set('Foo', 'Bar');
     $session->setOption('gc_divisor', 1);
     // 100% chance of gc
     $session->setOption('gc_probability', 1);
     $session->setOption('gc_maxlifetime', 50);
     $session->open();
     $session->close();
 }