Exemplo n.º 1
0
 /**
  * @covers Cradle\Sql\SqlFactory::load
  */
 public function testLoad()
 {
     $mysql = SqlFactory::load(include __DIR__ . '/../assets/sql/mysql.php');
     $this->assertInstanceOf('Cradle\\Sql\\MySql', $mysql);
     $pgsql = SqlFactory::load(include __DIR__ . '/../assets/sql/pgsql.php');
     $this->assertInstanceOf('Cradle\\Sql\\PostGreSql', $pgsql);
     $sqlite = SqlFactory::load(include __DIR__ . '/../assets/sql/sqlite.php');
     $this->assertInstanceOf('Cradle\\Sql\\Sqlite', $sqlite);
 }
Exemplo n.º 2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = SqlFactory::load(include __DIR__ . '/../assets/sql/pgsql.php');
     $schema = file_get_contents(__DIR__ . '/../assets/sql/pgsql-schema.sql');
     $this->object->query($schema);
 }
Exemplo n.º 3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $connection = (include __DIR__ . '/../assets/sql/sqlite.php');
     $this->object = SqlFactory::load($connection);
     $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 }