function testShouldNotStoreInSession2() { $_SESSION = array('make' => null, 'model' => null, 'year' => null); $vehicle = $this->createMMY(); $helper = $this->getHelper(array('search' => array('storeVehicleInSession' => '')), $vehicle->toValueArray()); $flexibleSearch = new VF_FlexibleSearch(new VF_Schema(), $this->getRequest($vehicle->toValueArray())); $flexibleSearch->storeFitInSession(); unset($_SESSION['garage']); $this->assertNotEquals($vehicle->toValueArray(), $_SESSION, 'should get global configuration'); }
public function onBootstrap(MvcEvent $e) { if (!isset($_SESSION)) { session_start(); } define('ELITE_CONFIG_DEFAULT', dirname(__FILE__) . '/config.default.ini'); define('ELITE_CONFIG', dirname(__FILE__) . '/config.ini'); define('ELITE_PATH', ''); /** @var $zf2DB \Zend\Db\Adapter\Adapter */ $zf2DB = $e->getApplication()->getServiceManager()->get('Zend\\Db\\Adapter\\Adapter'); $pdo = $zf2DB->getDriver()->getConnection()->getResource(); $zf1DB = $this->createDB($pdo); \VF_Singleton::getInstance()->setReadAdapter($zf1DB); \VF_Singleton::getInstance()->setRequest(new \Zend_Controller_Request_Http()); \VF_Singleton::getInstance()->setProcessURL('/vf/process?'); $search = new \VF_FlexibleSearch(new \VF_Schema(), new \Zend_Controller_Request_Http()); //$search->setConfig(new \Zend_Config(array())); $search->storeFitInSession(); }
function getValueForSelectedLevel($level) { $search = new VF_FlexibleSearch($this->schema(), $this->getRequest()); $search->storeFitInSession(); return $search->getValueForSelectedLevel($level); }