Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $connection = new Connection('sqlite', array('driver' => 'sqlite', 'database' => ':memory:'));
     $this->qb = new QueryBuilderHandler($connection);
     $this->qb->query("CREATE TABLE sample(\n                       t_key             TEXT     NOT NULL,\n                       t_value           TEXT    NOT NULL\n                    );");
     for ($i = 1; $i <= 100; $i++) {
         $record = array('t_key' => 'Key ' . $i, 't_value' => 'Value ' . $i);
         $this->qb->table('sample')->insert($record);
     }
 }
Esempio n. 2
0
 public function setUp()
 {
     parent::setUp();
     $config = new Configuration();
     $connectionParams = array('dbname' => ':memory:', 'driver' => 'pdo_sqlite');
     $conn = DriverManager::getConnection($connectionParams, $config);
     $this->qb = $conn->createQueryBuilder();
     $sql = "CREATE TABLE sample(\n                       t_key             TEXT     NOT NULL,\n                       t_value           TEXT    NOT NULL\n                    );";
     $conn->query($sql);
     for ($i = 1; $i <= 90; $i++) {
         $conn->query("INSERT INTO SAMPLE VALUES ('Key{$i}', 'Value{$i}')");
     }
 }
Esempio n. 3
0
 public function setUp()
 {
     parent::setUp();
     $capsule = new Capsule();
     $capsule->addConnection(array('driver' => 'sqlite', 'database' => ':memory:'));
     $capsule->setAsGlobal();
     $capsule->bootEloquent();
     Capsule::statement("CREATE TABLE sample(\n                       t_key             TEXT     NOT NULL,\n                       t_value           TEXT    NOT NULL\n                    );");
     for ($i = 1; $i <= 100; $i++) {
         $record = array('t_key' => 'Key ' . $i, 't_value' => 'Value ' . $i);
         Capsule::table('sample')->insert($record);
     }
 }