public function test_can_resolve() { $resolved = $this->connection->resolve(['driver' => 'pdo_mysql', 'host' => 'host', 'database' => 'database', 'username' => 'username', 'password' => 'password', 'charset' => 'charset', 'port' => 'port', 'unix_socket' => 'unix_socket', 'prefix' => 'prefix']); $this->assertEquals('pdo_mysql', $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('unix_socket', $resolved['unix_socket']); $this->assertEquals('prefix', $resolved['prefix']); }
public function test_can_resolve() { $this->config->shouldReceive('get')->with('database.connections.mysql.host')->once()->andReturn('host'); $this->config->shouldReceive('get')->with('database.connections.mysql.database')->once()->andReturn('database'); $this->config->shouldReceive('get')->with('database.connections.mysql.username')->once()->andReturn('username'); $this->config->shouldReceive('get')->with('database.connections.mysql.password')->once()->andReturn('password'); $this->config->shouldReceive('get')->with('database.connections.mysql.charset')->once()->andReturn('charset'); $this->config->shouldReceive('get')->with('database.connections.mysql.port')->once()->andReturn('port'); $this->config->shouldReceive('get')->with('database.connections.mysql.unix_socket')->once()->andReturn('unix_socket'); $this->config->shouldReceive('get')->with('database.connections.mysql.prefix')->once()->andReturn('prefix'); $resolved = $this->connection->resolve(); $this->assertEquals('pdo_mysql', $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('unix_socket', $resolved['unix_socket']); $this->assertEquals('prefix', $resolved['prefix']); }