public function testGetInstance()
 {
     $factory = PollConnectionFactory::getInstance();
     $this->assertType('PollConnectionFactory', $factory);
     $conn = $factory->getConnection();
     $this->assertType('PDO', $conn);
 }
 /**
  * @return PollConnectionFactory
  */
 public static function getInstance()
 {
     if (empty(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 protected function truncateItemTable()
 {
     $sql = "TRUNCATE TABLE " . $this->getItemDataGenerator()->getTablename();
     PollConnectionFactory::getInstance()->getConnection()->exec($sql);
 }
 /**
  * @return PDO
  */
 public function getConnection()
 {
     return PollConnectionFactory::getInstance()->getConnection();
 }