예제 #1
0
 function setUpSuite()
 {
     // setup DBs with necessary SQL
     $factory = $this->getFactory();
     $this->dbs = $factory->getAllDb();
     $factory->setupSqlIn(T_ROOT_DIR . 'acl/_sql/', $this->dbs);
     // create gatways to cycle over
     $gateways = array();
     $di = new T_Factory_Di();
     $di->willUse('T_Test_User_Stub');
     foreach ($this->dbs as $db) {
         $m = $db->master();
         $m->query('ALTER TABLE person ADD pwd VARCHAR(40)');
         $m->query('ALTER TABLE person ADD salt TEXT');
         $m->query('ALTER TABLE person ADD name TEXT');
         $m->query('ALTER TABLE person ADD country INT');
         $m->query('ALTER TABLE person ADD phone_num TEXT');
         $m->query('ALTER TABLE person ADD phone_ext TEXT');
         $gateways[] = new T_Test_User_Gateway_Stub($db, $di);
     }
     $this->cycleOn('gw', $gateways);
 }
예제 #2
0
 /**
  * Setup autoload and error handling.
  */
 function __construct()
 {
     parent::__construct();
     spl_autoload_register(array($this, 'handleAutoload'));
     set_exception_handler(array($this, 'handleException'));
     set_error_handler(array($this, 'handleError'));
     date_default_timezone_set('UTC');
     if (version_compare(PHP_VERSION, '5.3.0', '<')) {
         set_magic_quotes_runtime(0);
     }
     ini_set('auto_detect_line_endings', 1);
     $this->willUse(new T_Exception_Handler());
     // single exception handler
 }