Skip to content

Commit 66deaa5

Browse files
Merge branch '1.2' into 1.3
2 parents 0802a79 + 0737666 commit 66deaa5

File tree

11 files changed

+95
-79
lines changed

11 files changed

+95
-79
lines changed

src/Configuration/Connections/MysqlConnection.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ class MysqlConnection extends Connection
1212
public function resolve(array $settings = [])
1313
{
1414
return [
15-
'driver' => 'pdo_mysql',
16-
'host' => array_get($settings, 'host'),
17-
'dbname' => array_get($settings, 'database'),
18-
'user' => array_get($settings, 'username'),
19-
'password' => array_get($settings, 'password'),
20-
'charset' => array_get($settings, 'charset'),
21-
'port' => array_get($settings, 'port'),
22-
'unix_socket' => array_get($settings, 'unix_socket'),
23-
'prefix' => array_get($settings, 'prefix'),
15+
'driver' => 'pdo_mysql',
16+
'host' => array_get($settings, 'host'),
17+
'dbname' => array_get($settings, 'database'),
18+
'user' => array_get($settings, 'username'),
19+
'password' => array_get($settings, 'password'),
20+
'charset' => array_get($settings, 'charset'),
21+
'port' => array_get($settings, 'port'),
22+
'unix_socket' => array_get($settings, 'unix_socket'),
23+
'prefix' => array_get($settings, 'prefix'),
24+
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
2425
];
2526
}
2627
}

src/Configuration/Connections/OracleConnection.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ class OracleConnection extends Connection
1212
public function resolve(array $settings = [])
1313
{
1414
return [
15-
'driver' => 'oci8',
16-
'host' => array_get($settings, 'host'),
17-
'dbname' => array_get($settings, 'database'),
18-
'user' => array_get($settings, 'username'),
19-
'password' => array_get($settings, 'password'),
20-
'charset' => array_get($settings, 'charset'),
21-
'port' => array_get($settings, 'port'),
22-
'prefix' => array_get($settings, 'prefix'),
15+
'driver' => 'oci8',
16+
'host' => array_get($settings, 'host'),
17+
'dbname' => array_get($settings, 'database'),
18+
'user' => array_get($settings, 'username'),
19+
'password' => array_get($settings, 'password'),
20+
'charset' => array_get($settings, 'charset'),
21+
'port' => array_get($settings, 'port'),
22+
'prefix' => array_get($settings, 'prefix'),
23+
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
2324
];
2425
}
2526
}

src/Configuration/Connections/PgsqlConnection.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ class PgsqlConnection extends Connection
1212
public function resolve(array $settings = [])
1313
{
1414
return [
15-
'driver' => 'pdo_pgsql',
16-
'host' => array_get($settings, 'host'),
17-
'dbname' => array_get($settings, 'database'),
18-
'user' => array_get($settings, 'username'),
19-
'password' => array_get($settings, 'password'),
20-
'charset' => array_get($settings, 'charset'),
21-
'port' => array_get($settings, 'port'),
22-
'sslmode' => array_get($settings, 'sslmode'),
23-
'prefix' => array_get($settings, 'prefix'),
15+
'driver' => 'pdo_pgsql',
16+
'host' => array_get($settings, 'host'),
17+
'dbname' => array_get($settings, 'database'),
18+
'user' => array_get($settings, 'username'),
19+
'password' => array_get($settings, 'password'),
20+
'charset' => array_get($settings, 'charset'),
21+
'port' => array_get($settings, 'port'),
22+
'sslmode' => array_get($settings, 'sslmode'),
23+
'prefix' => array_get($settings, 'prefix'),
24+
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
2425
];
2526
}
2627
}

src/Configuration/Connections/SqliteConnection.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ class SqliteConnection extends Connection
1414
public function resolve(array $settings = [])
1515
{
1616
return [
17-
'driver' => 'pdo_sqlite',
18-
'user' => array_get($settings, 'username'),
19-
'password' => array_get($settings, 'password'),
20-
'prefix' => array_get($settings, 'prefix'),
21-
'memory' => $this->isMemory($settings),
22-
'path' => array_get($settings, 'database')
17+
'driver' => 'pdo_sqlite',
18+
'user' => array_get($settings, 'username'),
19+
'password' => array_get($settings, 'password'),
20+
'prefix' => array_get($settings, 'prefix'),
21+
'memory' => $this->isMemory($settings),
22+
'path' => array_get($settings, 'database'),
23+
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
2324
];
2425
}
2526

src/Configuration/Connections/SqlsrvConnection.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ class SqlsrvConnection extends Connection
1212
public function resolve(array $settings = [])
1313
{
1414
return [
15-
'driver' => 'pdo_sqlsrv',
16-
'host' => array_get($settings, 'host'),
17-
'dbname' => array_get($settings, 'database'),
18-
'user' => array_get($settings, 'username'),
19-
'password' => array_get($settings, 'password'),
20-
'port' => array_get($settings, 'port'),
21-
'prefix' => array_get($settings, 'prefix'),
22-
'charset' => array_get($settings, 'charset'),
15+
'driver' => 'pdo_sqlsrv',
16+
'host' => array_get($settings, 'host'),
17+
'dbname' => array_get($settings, 'database'),
18+
'user' => array_get($settings, 'username'),
19+
'password' => array_get($settings, 'password'),
20+
'port' => array_get($settings, 'port'),
21+
'prefix' => array_get($settings, 'prefix'),
22+
'charset' => array_get($settings, 'charset'),
23+
'defaultTableOptions' => array_get($settings, 'defaultTableOptions', []),
2324
];
2425
}
2526
}

src/EntityManagerFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace LaravelDoctrine\ORM;
44

5+
use Doctrine\Common\Cache\ArrayCache;
56
use Doctrine\Common\Cache\Cache;
67
use Doctrine\ORM\Cache\DefaultCacheFactory;
78
use Doctrine\ORM\Configuration;

tests/Configuration/Connections/MysqlConnectionTest.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ protected function setUp()
2727
public function test_can_resolve()
2828
{
2929
$resolved = $this->connection->resolve([
30-
'driver' => 'pdo_mysql',
31-
'host' => 'host',
32-
'database' => 'database',
33-
'username' => 'username',
34-
'password' => 'password',
35-
'charset' => 'charset',
36-
'port' => 'port',
37-
'unix_socket' => 'unix_socket',
38-
'prefix' => 'prefix'
30+
'driver' => 'pdo_mysql',
31+
'host' => 'host',
32+
'database' => 'database',
33+
'username' => 'username',
34+
'password' => 'password',
35+
'charset' => 'charset',
36+
'port' => 'port',
37+
'unix_socket' => 'unix_socket',
38+
'prefix' => 'prefix',
39+
'defaultTableOptions' => [],
3940
]);
4041

4142
$this->assertEquals('pdo_mysql', $resolved['driver']);
@@ -47,6 +48,7 @@ public function test_can_resolve()
4748
$this->assertEquals('port', $resolved['port']);
4849
$this->assertEquals('unix_socket', $resolved['unix_socket']);
4950
$this->assertEquals('prefix', $resolved['prefix']);
51+
$this->assertCount(0, $resolved['defaultTableOptions']);
5052
}
5153

5254
protected function tearDown()

tests/Configuration/Connections/OracleConnectionTest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ protected function setUp()
2727
public function test_can_resolve()
2828
{
2929
$resolved = $this->connection->resolve([
30-
'driver' => 'oci8',
31-
'host' => 'host',
32-
'database' => 'database',
33-
'username' => 'username',
34-
'password' => 'password',
35-
'charset' => 'charset',
36-
'port' => 'port',
37-
'prefix' => 'prefix'
30+
'driver' => 'oci8',
31+
'host' => 'host',
32+
'database' => 'database',
33+
'username' => 'username',
34+
'password' => 'password',
35+
'charset' => 'charset',
36+
'port' => 'port',
37+
'prefix' => 'prefix',
38+
'defaultTableOptions' => [],
3839
]);
3940

4041
$this->assertEquals('oci8', $resolved['driver']);
@@ -45,6 +46,7 @@ public function test_can_resolve()
4546
$this->assertEquals('charset', $resolved['charset']);
4647
$this->assertEquals('port', $resolved['port']);
4748
$this->assertEquals('prefix', $resolved['prefix']);
49+
$this->assertCount(0, $resolved['defaultTableOptions']);
4850
}
4951

5052
protected function tearDown()

tests/Configuration/Connections/PgsqlConnectionTest.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ protected function setUp()
2727
public function test_can_resolve()
2828
{
2929
$resolved = $this->connection->resolve([
30-
'driver' => 'pdo_pgsql',
31-
'host' => 'host',
32-
'database' => 'database',
33-
'username' => 'username',
34-
'password' => 'password',
35-
'charset' => 'charset',
36-
'port' => 'port',
37-
'prefix' => 'prefix',
38-
'sslmode' => 'sslmode'
30+
'driver' => 'pdo_pgsql',
31+
'host' => 'host',
32+
'database' => 'database',
33+
'username' => 'username',
34+
'password' => 'password',
35+
'charset' => 'charset',
36+
'port' => 'port',
37+
'prefix' => 'prefix',
38+
'sslmode' => 'sslmode',
39+
'defaultTableOptions' => [],
3940
]);
4041

4142
$this->assertEquals('pdo_pgsql', $resolved['driver']);
@@ -47,6 +48,7 @@ public function test_can_resolve()
4748
$this->assertEquals('port', $resolved['port']);
4849
$this->assertEquals('sslmode', $resolved['sslmode']);
4950
$this->assertEquals('prefix', $resolved['prefix']);
51+
$this->assertCount(0, $resolved['defaultTableOptions']);
5052
}
5153

5254
protected function tearDown()

tests/Configuration/Connections/SqliteConnectionTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ protected function setUp()
2727
public function test_can_resolve()
2828
{
2929
$resolved = $this->connection->resolve([
30-
'driver' => 'pdo_sqlite',
31-
'database' => 'path',
32-
'username' => 'username',
33-
'password' => 'password',
34-
'prefix' => 'prefix',
30+
'driver' => 'pdo_sqlite',
31+
'database' => 'path',
32+
'username' => 'username',
33+
'password' => 'password',
34+
'prefix' => 'prefix',
35+
'defaultTableOptions' => [],
3536
]);
3637

3738
$this->assertEquals('pdo_sqlite', $resolved['driver']);
@@ -40,6 +41,7 @@ public function test_can_resolve()
4041
$this->assertEquals('prefix', $resolved['prefix']);
4142
$this->assertFalse($resolved['memory']);
4243
$this->assertEquals('path', $resolved['path']);
44+
$this->assertCount(0, $resolved['defaultTableOptions']);
4345
}
4446

4547
public function test_can_resolve_with_in_memory_database()

0 commit comments

Comments
 (0)