Skip to content

Commit

Permalink
Merge branch '1.2' into 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrouwers committed Apr 3, 2017
2 parents 0802a79 + 0737666 commit 66deaa5
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 79 deletions.
19 changes: 10 additions & 9 deletions src/Configuration/Connections/MysqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ class MysqlConnection extends Connection
public function resolve(array $settings = [])
{
return [
'driver' => 'pdo_mysql',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'unix_socket' => array_get($settings, 'unix_socket'),
'prefix' => array_get($settings, 'prefix'),
'driver' => 'pdo_mysql',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'unix_socket' => array_get($settings, 'unix_socket'),
'prefix' => array_get($settings, 'prefix'),
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
];
}
}
17 changes: 9 additions & 8 deletions src/Configuration/Connections/OracleConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ class OracleConnection extends Connection
public function resolve(array $settings = [])
{
return [
'driver' => 'oci8',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'prefix' => array_get($settings, 'prefix'),
'driver' => 'oci8',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'prefix' => array_get($settings, 'prefix'),
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
];
}
}
19 changes: 10 additions & 9 deletions src/Configuration/Connections/PgsqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ class PgsqlConnection extends Connection
public function resolve(array $settings = [])
{
return [
'driver' => 'pdo_pgsql',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'sslmode' => array_get($settings, 'sslmode'),
'prefix' => array_get($settings, 'prefix'),
'driver' => 'pdo_pgsql',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'charset' => array_get($settings, 'charset'),
'port' => array_get($settings, 'port'),
'sslmode' => array_get($settings, 'sslmode'),
'prefix' => array_get($settings, 'prefix'),
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
];
}
}
13 changes: 7 additions & 6 deletions src/Configuration/Connections/SqliteConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ class SqliteConnection extends Connection
public function resolve(array $settings = [])
{
return [
'driver' => 'pdo_sqlite',
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'prefix' => array_get($settings, 'prefix'),
'memory' => $this->isMemory($settings),
'path' => array_get($settings, 'database')
'driver' => 'pdo_sqlite',
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'prefix' => array_get($settings, 'prefix'),
'memory' => $this->isMemory($settings),
'path' => array_get($settings, 'database'),
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
];
}

Expand Down
17 changes: 9 additions & 8 deletions src/Configuration/Connections/SqlsrvConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ class SqlsrvConnection extends Connection
public function resolve(array $settings = [])
{
return [
'driver' => 'pdo_sqlsrv',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'port' => array_get($settings, 'port'),
'prefix' => array_get($settings, 'prefix'),
'charset' => array_get($settings, 'charset'),
'driver' => 'pdo_sqlsrv',
'host' => array_get($settings, 'host'),
'dbname' => array_get($settings, 'database'),
'user' => array_get($settings, 'username'),
'password' => array_get($settings, 'password'),
'port' => array_get($settings, 'port'),
'prefix' => array_get($settings, 'prefix'),
'charset' => array_get($settings, 'charset'),
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
];
}
}
1 change: 1 addition & 0 deletions src/EntityManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LaravelDoctrine\ORM;

use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\Cache;
use Doctrine\ORM\Cache\DefaultCacheFactory;
use Doctrine\ORM\Configuration;
Expand Down
20 changes: 11 additions & 9 deletions tests/Configuration/Connections/MysqlConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ protected function setUp()
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'
'driver' => 'pdo_mysql',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'charset' => 'charset',
'port' => 'port',
'unix_socket' => 'unix_socket',
'prefix' => 'prefix',
'defaultTableOptions' => [],
]);

$this->assertEquals('pdo_mysql', $resolved['driver']);
Expand All @@ -47,6 +48,7 @@ public function test_can_resolve()
$this->assertEquals('port', $resolved['port']);
$this->assertEquals('unix_socket', $resolved['unix_socket']);
$this->assertEquals('prefix', $resolved['prefix']);
$this->assertCount(0, $resolved['defaultTableOptions']);
}

protected function tearDown()
Expand Down
18 changes: 10 additions & 8 deletions tests/Configuration/Connections/OracleConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ protected function setUp()
public function test_can_resolve()
{
$resolved = $this->connection->resolve([
'driver' => 'oci8',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'charset' => 'charset',
'port' => 'port',
'prefix' => 'prefix'
'driver' => 'oci8',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'charset' => 'charset',
'port' => 'port',
'prefix' => 'prefix',
'defaultTableOptions' => [],
]);

$this->assertEquals('oci8', $resolved['driver']);
Expand All @@ -45,6 +46,7 @@ public function test_can_resolve()
$this->assertEquals('charset', $resolved['charset']);
$this->assertEquals('port', $resolved['port']);
$this->assertEquals('prefix', $resolved['prefix']);
$this->assertCount(0, $resolved['defaultTableOptions']);
}

protected function tearDown()
Expand Down
20 changes: 11 additions & 9 deletions tests/Configuration/Connections/PgsqlConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ protected function setUp()
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'
'driver' => 'pdo_pgsql',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'charset' => 'charset',
'port' => 'port',
'prefix' => 'prefix',
'sslmode' => 'sslmode',
'defaultTableOptions' => [],
]);

$this->assertEquals('pdo_pgsql', $resolved['driver']);
Expand All @@ -47,6 +48,7 @@ public function test_can_resolve()
$this->assertEquals('port', $resolved['port']);
$this->assertEquals('sslmode', $resolved['sslmode']);
$this->assertEquals('prefix', $resolved['prefix']);
$this->assertCount(0, $resolved['defaultTableOptions']);
}

protected function tearDown()
Expand Down
12 changes: 7 additions & 5 deletions tests/Configuration/Connections/SqliteConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ protected function setUp()
public function test_can_resolve()
{
$resolved = $this->connection->resolve([
'driver' => 'pdo_sqlite',
'database' => 'path',
'username' => 'username',
'password' => 'password',
'prefix' => 'prefix',
'driver' => 'pdo_sqlite',
'database' => 'path',
'username' => 'username',
'password' => 'password',
'prefix' => 'prefix',
'defaultTableOptions' => [],
]);

$this->assertEquals('pdo_sqlite', $resolved['driver']);
Expand All @@ -40,6 +41,7 @@ public function test_can_resolve()
$this->assertEquals('prefix', $resolved['prefix']);
$this->assertFalse($resolved['memory']);
$this->assertEquals('path', $resolved['path']);
$this->assertCount(0, $resolved['defaultTableOptions']);
}

public function test_can_resolve_with_in_memory_database()
Expand Down
18 changes: 10 additions & 8 deletions tests/Configuration/Connections/SqlsrvConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ protected function setUp()
public function test_can_resolve()
{
$resolved = $this->connection->resolve([
'driver' => 'pdo_sqlsrv',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'port' => 'port',
'prefix' => 'prefix',
'charset' => 'charset'
'driver' => 'pdo_sqlsrv',
'host' => 'host',
'database' => 'database',
'username' => 'username',
'password' => 'password',
'port' => 'port',
'prefix' => 'prefix',
'charset' => 'charset',
'defaultTableOptions' => [],
]);

$this->assertEquals('pdo_sqlsrv', $resolved['driver']);
Expand All @@ -45,6 +46,7 @@ public function test_can_resolve()
$this->assertEquals('port', $resolved['port']);
$this->assertEquals('prefix', $resolved['prefix']);
$this->assertEquals('charset', $resolved['charset']);
$this->assertCount(0, $resolved['defaultTableOptions']);
}

protected function tearDown()
Expand Down

0 comments on commit 66deaa5

Please sign in to comment.