public function testSetters()
 {
     $options = new DbTableGatewayOptions();
     $options->setIdColumn('testId')->setNameColumn('testName')->setModifiedColumn('testModified')->setLifetimeColumn('testLifetime')->setDataColumn('testData');
     $this->assertEquals('testId', $options->getIdColumn());
     $this->assertEquals('testName', $options->getNameColumn());
     $this->assertEquals('testModified', $options->getModifiedColumn());
     $this->assertEquals('testLifetime', $options->getLifetimeColumn());
     $this->assertEquals('testData', $options->getDataColumn());
 }
Ejemplo n.º 2
0
 public function setSessionStorage()
 {
     $gwOpts = new DbTableGatewayOptions();
     $gwOpts->setDataColumn('data');
     $gwOpts->setIdColumn('id');
     $gwOpts->setLifetimeColumn('lifetime');
     $gwOpts->setModifiedColumn('modified');
     $gwOpts->setNameColumn('name');
     if (isset($this->serviceConfig['base64Encode']) && $this->serviceConfig['base64Encode']) {
         $saveHandler = new EncodedDbTableGateway($this->tblGW, $gwOpts);
     } else {
         $saveHandler = new DbTableGateway($this->tblGW, $gwOpts);
     }
     $sessionManager = new SessionManager();
     if ($this->sessionConfig) {
         $sessionConfig = new \Zend\Session\Config\SessionConfig();
         $sessionConfig->setOptions($this->sessionConfig);
         $sessionManager->setConfig($sessionConfig);
     }
     $sessionManager->setSaveHandler($saveHandler);
     Container::setDefaultManager($sessionManager);
     $sessionManager->start();
 }