コード例 #1
0
ファイル: PgsqlConnectionTest.php プロジェクト: Devitek/orm
 public function test_can_resolve()
 {
     $resolved = $this->connection->resolve(['driver' => 'pdo_pgsql', 'host' => 'host', 'database' => 'database', 'username' => 'username', 'password' => 'password', 'charset' => 'charset', 'port' => 'port', 'prefix' => 'prefix', 'sslmode' => 'sslmode']);
     $this->assertEquals('pdo_pgsql', $resolved['driver']);
     $this->assertEquals('host', $resolved['host']);
     $this->assertEquals('database', $resolved['dbname']);
     $this->assertEquals('username', $resolved['user']);
     $this->assertEquals('password', $resolved['password']);
     $this->assertEquals('charset', $resolved['charset']);
     $this->assertEquals('port', $resolved['port']);
     $this->assertEquals('sslmode', $resolved['sslmode']);
     $this->assertEquals('prefix', $resolved['prefix']);
 }
コード例 #2
0
ファイル: PgsqlConnectionTest.php プロジェクト: ryan-senn/orm
 public function test_can_resolve()
 {
     $this->config->shouldReceive('get')->with('database.connections.pgsql.host')->once()->andReturn('host');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.database')->once()->andReturn('database');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.username')->once()->andReturn('username');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.password')->once()->andReturn('password');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.charset')->once()->andReturn('charset');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.port')->once()->andReturn('port');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.sslmode')->once()->andReturn('sslmode');
     $this->config->shouldReceive('get')->with('database.connections.pgsql.prefix')->once()->andReturn('prefix');
     $resolved = $this->connection->resolve();
     $this->assertEquals('pdo_pgsql', $resolved['driver']);
     $this->assertEquals('host', $resolved['host']);
     $this->assertEquals('database', $resolved['dbname']);
     $this->assertEquals('username', $resolved['user']);
     $this->assertEquals('password', $resolved['password']);
     $this->assertEquals('charset', $resolved['charset']);
     $this->assertEquals('port', $resolved['port']);
     $this->assertEquals('sslmode', $resolved['sslmode']);
     $this->assertEquals('prefix', $resolved['prefix']);
 }