/** * @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); }
/** * 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); }
/** * 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); }