Example #1
0
 /**
  * @return YoPdo
  */
 public function getYoPdo()
 {
     if ($this->yo_pdo) {
         return $this->yo_pdo;
     }
     $factory = new YoPdoFactory();
     $this->yo_pdo = $factory->createFromConfig($this->config);
     return $this->yo_pdo;
 }
Example #2
0
 /**
  * @return array
  */
 public function dbProvider()
 {
     $factory = new Factory();
     $yo_pdo = $factory->createFromConfig($this->getConfig());
     return array(array($yo_pdo));
 }
Example #3
0
 /**
  * @return array
  */
 public function dbProvider()
 {
     $config = (require __DIR__ . '/../config/config.php');
     $factory = new Factory();
     $yo_pdo = $factory->createFromConfig($config['database']);
     return array(array($yo_pdo));
 }
Example #4
0
 public function testPdoCanBeUsedAfterYoPdoIsCreatedFromConfigArray()
 {
     $factory = new Factory();
     $yo_pdo = $factory->createFromConfig($this->getConfig());
     $this->assertEquals(1, $yo_pdo->getPdo()->query('SELECT 1')->fetchColumn(0));
 }