Example #1
0
 public function testConnect()
 {
     $this->app = App::getInstance();
     $this->app->loadConfig();
     $this->assertInstanceOf(App::class, $this->app);
     // expects correct default database setup
     try {
         $this->app->connect();
     } catch (\PDOException $e) {
         $this->markTestIncomplete($e->getMessage());
     }
     $this->assertInstanceOf(PDO::class, $this->app->pdo);
     $this->app->connect('test_stream');
     $this->assertInstanceOf(PDO::class, $this->app->pdo);
     $this->expectException(Exception::class);
     $this->app->connect('not_existing_database_configuration_key');
 }