Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
6fb7a4b6
Commit
6fb7a4b6
authored
Jul 22, 2017
by
Marco Pivetta
Committed by
GitHub
Jul 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2782 from lcobucci/fix/stop-using-deprecated-types
Stop using deprecated "json_array" type
parents
38a76a90
0b50739e
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
78 additions
and
55 deletions
+78
-55
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+1
-1
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+2
-2
MySQL57Platform.php
lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
+3
-2
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+4
-4
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+2
-2
PostgreSQL91Platform.php
lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php
+1
-1
PostgreSQL92Platform.php
lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php
+5
-2
PostgreSQL94Platform.php
lib/Doctrine/DBAL/Platforms/PostgreSQL94Platform.php
+5
-2
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+1
-1
SQLAnywhere11Platform.php
lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php
+1
-1
SQLAnywhere12Platform.php
lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php
+1
-1
SQLAnywhere16Platform.php
lib/Doctrine/DBAL/Platforms/SQLAnywhere16Platform.php
+1
-1
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+2
-2
SQLServer2005Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php
+1
-1
SQLServer2008Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php
+1
-1
SQLServer2012Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
+2
-2
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+3
-3
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+5
-5
PostgreSqlSchemaManager.php
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
+1
-1
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+17
-6
MySQL57PlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/MySQL57PlatformTest.php
+2
-1
PostgreSQL92PlatformTest.php
...octrine/Tests/DBAL/Platforms/PostgreSQL92PlatformTest.php
+2
-1
PostgreSQL94PlatformTest.php
...octrine/Tests/DBAL/Platforms/PostgreSQL94PlatformTest.php
+2
-1
PostgreSQLSchemaManagerTest.php
...octrine/Tests/DBAL/Schema/PostgreSQLSchemaManagerTest.php
+13
-11
No files found.
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
6fb7a4b6
...
...
@@ -876,6 +876,6 @@ class DB2Platform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'
;
return
Keywords\DB2Keywords
::
class
;
}
}
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
6fb7a4b6
...
...
@@ -20,9 +20,9 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Types\BinaryType
;
/**
...
...
@@ -314,7 +314,7 @@ class DrizzlePlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\DrizzleKeywords'
;
return
Keywords\DrizzleKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
View file @
6fb7a4b6
...
...
@@ -21,6 +21,7 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Types\Type
;
/**
* Provides the behavior, features and SQL dialect of the MySQL 5.7 (5.7.9 GA) database platform.
...
...
@@ -79,7 +80,7 @@ class MySQL57Platform extends MySqlPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords'
;
return
Keywords\MySQL57Keywords
::
class
;
}
/**
...
...
@@ -89,6 +90,6 @@ class MySQL57Platform extends MySqlPlatform
{
parent
::
initializeDoctrineTypeMappings
();
$this
->
doctrineTypeMapping
[
'json'
]
=
'json_array'
;
$this
->
doctrineTypeMapping
[
'json'
]
=
Type
::
JSON
;
}
}
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
6fb7a4b6
...
...
@@ -19,13 +19,13 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Types\BlobType
;
use
Doctrine\DBAL\Types\TextType
;
use
Doctrine\DBAL\Connection
;
/**
* The MySqlPlatform provides the behavior, features and SQL dialect of the
...
...
@@ -712,7 +712,7 @@ class MySqlPlatform extends AbstractPlatform
if
(
!
$diff
->
fromTable
->
hasColumn
(
$columnName
))
{
continue
;
}
$column
=
$diff
->
fromTable
->
getColumn
(
$columnName
);
if
(
$column
->
getAutoincrement
()
===
true
)
{
...
...
@@ -1070,7 +1070,7 @@ class MySqlPlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'
;
return
Keywords\MySQLKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
6fb7a4b6
...
...
@@ -19,13 +19,13 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Sequence
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Types\BinaryType
;
/**
...
...
@@ -1156,7 +1156,7 @@ END;';
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'
;
return
Keywords\OracleKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php
View file @
6fb7a4b6
...
...
@@ -41,7 +41,7 @@ class PostgreSQL91Platform extends PostgreSqlPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\PostgreSQL91Keywords'
;
return
Keywords\PostgreSQL91Keywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php
View file @
6fb7a4b6
...
...
@@ -19,6 +19,8 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Types\Type
;
/**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.2 database platform.
*
...
...
@@ -61,7 +63,7 @@ class PostgreSQL92Platform extends PostgreSQL91Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords'
;
return
Keywords\PostgreSQL92Keywords
::
class
;
}
/**
...
...
@@ -70,7 +72,8 @@ class PostgreSQL92Platform extends PostgreSQL91Platform
protected
function
initializeDoctrineTypeMappings
()
{
parent
::
initializeDoctrineTypeMappings
();
$this
->
doctrineTypeMapping
[
'json'
]
=
'json_array'
;
$this
->
doctrineTypeMapping
[
'json'
]
=
Type
::
JSON
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/PostgreSQL94Platform.php
View file @
6fb7a4b6
...
...
@@ -19,6 +19,8 @@
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Types\Type
;
/**
* Provides the behavior, features and SQL dialect of the PostgreSQL 9.4 database platform.
*
...
...
@@ -45,7 +47,7 @@ class PostgreSQL94Platform extends PostgreSQL92Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords'
;
return
Keywords\PostgreSQL94Keywords
::
class
;
}
/**
...
...
@@ -54,6 +56,7 @@ class PostgreSQL94Platform extends PostgreSQL92Platform
protected
function
initializeDoctrineTypeMappings
()
{
parent
::
initializeDoctrineTypeMappings
();
$this
->
doctrineTypeMapping
[
'jsonb'
]
=
'json_array'
;
$this
->
doctrineTypeMapping
[
'jsonb'
]
=
Type
::
JSON
;
}
}
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
6fb7a4b6
...
...
@@ -1166,7 +1166,7 @@ class PostgreSqlPlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords'
;
return
Keywords\PostgreSQLKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywhere11Platform.php
View file @
6fb7a4b6
...
...
@@ -42,6 +42,6 @@ class SQLAnywhere11Platform extends SQLAnywherePlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere11Keywords'
;
return
Keywords\SQLAnywhere11Keywords
::
class
;
}
}
lib/Doctrine/DBAL/Platforms/SQLAnywhere12Platform.php
View file @
6fb7a4b6
...
...
@@ -121,7 +121,7 @@ class SQLAnywhere12Platform extends SQLAnywhere11Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere12Keywords'
;
return
Keywords\SQLAnywhere12Keywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywhere16Platform.php
View file @
6fb7a4b6
...
...
@@ -55,6 +55,6 @@ class SQLAnywhere16Platform extends SQLAnywhere12Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhere16Keywords'
;
return
Keywords\SQLAnywhere16Keywords
::
class
;
}
}
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
6fb7a4b6
...
...
@@ -26,8 +26,8 @@ use Doctrine\DBAL\Schema\Column;
use
Doctrine\DBAL\Schema\ColumnDiff
;
use
Doctrine\DBAL\Schema\Constraint
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
...
...
@@ -1429,7 +1429,7 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLAnywhereKeywords'
;
return
Keywords\SQLAnywhereKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php
View file @
6fb7a4b6
...
...
@@ -58,6 +58,6 @@ class SQLServer2005Platform extends SQLServerPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords'
;
return
Keywords\SQLServer2005Keywords
::
class
;
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php
View file @
6fb7a4b6
...
...
@@ -114,6 +114,6 @@ class SQLServer2008Platform extends SQLServer2005Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords'
;
return
Keywords\SQLServer2008Keywords
::
class
;
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
View file @
6fb7a4b6
...
...
@@ -101,7 +101,7 @@ class SQLServer2012Platform extends SQLServer2008Platform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords'
;
return
Keywords\SQLServer2012Keywords
::
class
;
}
/**
...
...
@@ -122,7 +122,7 @@ class SQLServer2012Platform extends SQLServer2008Platform
if
(
$matchesCount
>
0
)
{
$orderByPos
=
$matches
[
0
][(
$matchesCount
-
1
)][
1
];
}
if
(
$orderByPos
===
false
||
substr_count
(
$query
,
"("
,
$orderByPos
)
-
substr_count
(
$query
,
")"
,
$orderByPos
)
)
{
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
6fb7a4b6
...
...
@@ -22,11 +22,11 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\LockMode
;
use
Doctrine\DBAL\Schema\Column
;
use
Doctrine\DBAL\Schema\ColumnDiff
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
/**
* The SQLServerPlatform provides the behavior, features and SQL dialect of the
...
...
@@ -1512,7 +1512,7 @@ class SQLServerPlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords'
;
return
Keywords\SQLServerKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
6fb7a4b6
...
...
@@ -21,12 +21,12 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Schema\Column
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\Constraint
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Constraint
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
/**
* The SqlitePlatform class describes the specifics and dialects of the SQLite
...
...
@@ -633,7 +633,7 @@ class SqlitePlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords'
;
return
Keywords\SQLiteKeywords
::
class
;
}
/**
...
...
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
View file @
6fb7a4b6
...
...
@@ -444,7 +444,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$column
->
setPlatformOption
(
'collation'
,
$tableColumn
[
'collation'
]);
}
if
(
$column
->
getType
()
->
getName
()
===
'json_array'
)
{
if
(
in_array
(
$column
->
getType
()
->
getName
(),
[
Type
::
JSON_ARRAY
,
Type
::
JSON
],
true
)
)
{
$column
->
setPlatformOption
(
'jsonb'
,
$jsonb
);
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
6fb7a4b6
...
...
@@ -28,7 +28,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$params
=
$this
->
_conn
->
getParams
();
$paths
=
$this
->
_sm
->
getSchemaSearchPaths
();
$this
->
assertEquals
(
array
(
$params
[
'user'
],
'public'
)
,
$paths
);
$this
->
assertEquals
(
[
$params
[
'user'
],
'public'
]
,
$paths
);
}
/**
...
...
@@ -40,7 +40,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
assertInternalType
(
'array'
,
$names
);
$this
->
assertTrue
(
count
(
$names
)
>
0
);
$this
->
assert
True
(
in_array
(
'public'
,
$names
),
"The public schema should be found."
);
$this
->
assert
Contains
(
'public'
,
$names
,
'The public schema should be found.'
);
}
/**
...
...
@@ -366,7 +366,10 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
assertSame
(
'(id IS NULL)'
,
$onlineTable
->
getIndex
(
'simple_partial_index'
)
->
getOption
(
'where'
));
}
public
function
testJsonbColumn
()
/**
* @dataProvider jsonbColumnTypeProvider
*/
public
function
testJsonbColumn
(
string
$type
)
:
void
{
if
(
!
$this
->
_sm
->
getDatabasePlatform
()
instanceof
PostgreSQL94Platform
)
{
$this
->
markTestSkipped
(
"Requires PostgresSQL 9.4+"
);
...
...
@@ -374,14 +377,22 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
}
$table
=
new
Schema\Table
(
'test_jsonb'
);
$table
->
addColumn
(
'foo'
,
'json_array'
)
->
setPlatformOption
(
'jsonb'
,
true
);
$table
->
addColumn
(
'foo'
,
$type
)
->
setPlatformOption
(
'jsonb'
,
true
);
$this
->
_sm
->
dropAndCreateTable
(
$table
);
/** @var Schema\Column[] $columns */
$columns
=
$this
->
_sm
->
listTableColumns
(
'test_jsonb'
);
$this
->
assertEquals
(
'json_array'
,
$columns
[
'foo'
]
->
getType
()
->
getName
());
$this
->
assertEquals
(
true
,
$columns
[
'foo'
]
->
getPlatformOption
(
'jsonb'
));
$this
->
assertSame
(
TYPE
::
JSON
,
$columns
[
'foo'
]
->
getType
()
->
getName
());
$this
->
assertTrue
(
true
,
$columns
[
'foo'
]
->
getPlatformOption
(
'jsonb'
));
}
public
function
jsonbColumnTypeProvider
()
:
array
{
return
[
[
Type
::
JSON
],
[
Type
::
JSON_ARRAY
],
];
}
/**
...
...
tests/Doctrine/Tests/DBAL/Platforms/MySQL57PlatformTest.php
View file @
6fb7a4b6
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Platforms
;
use
Doctrine\DBAL\Platforms\MySQL57Platform
;
use
Doctrine\DBAL\Types\Type
;
class
MySQL57PlatformTest
extends
AbstractMySQLPlatformTestCase
{
...
...
@@ -27,7 +28,7 @@ class MySQL57PlatformTest extends AbstractMySQLPlatformTestCase
public
function
testInitializesJsonTypeMapping
()
{
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'json'
));
$this
->
assertSame
(
'json_array'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'json'
));
$this
->
assertSame
(
Type
::
JSON
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'json'
));
}
/**
...
...
tests/Doctrine/Tests/DBAL/Platforms/PostgreSQL92PlatformTest.php
View file @
6fb7a4b6
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Platforms
;
use
Doctrine\DBAL\Platforms\PostgreSQL92Platform
;
use
Doctrine\DBAL\Types\Type
;
class
PostgreSQL92PlatformTest
extends
AbstractPostgreSqlPlatformTestCase
{
...
...
@@ -54,7 +55,7 @@ class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
public
function
testInitializesJsonTypeMapping
()
{
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'json'
));
$this
->
assertEquals
(
'json_array'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'json'
));
$this
->
assertEquals
(
Type
::
JSON
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'json'
));
}
/**
...
...
tests/Doctrine/Tests/DBAL/Platforms/PostgreSQL94PlatformTest.php
View file @
6fb7a4b6
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Platforms
;
use
Doctrine\DBAL\Platforms\PostgreSQL94Platform
;
use
Doctrine\DBAL\Types\Type
;
class
PostgreSQL94PlatformTest
extends
PostgreSQL92PlatformTest
{
...
...
@@ -25,6 +26,6 @@ class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{
parent
::
testInitializesJsonTypeMapping
();
$this
->
assertTrue
(
$this
->
_platform
->
hasDoctrineTypeMappingFor
(
'jsonb'
));
$this
->
assertEquals
(
'json_array'
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'jsonb'
));
$this
->
assertEquals
(
Type
::
JSON
,
$this
->
_platform
->
getDoctrineTypeMapping
(
'jsonb'
));
}
}
tests/Doctrine/Tests/DBAL/Schema/PostgreSQLSchemaManagerTest.php
View file @
6fb7a4b6
...
...
@@ -22,9 +22,11 @@ class PostgreSQLSchemaManagerTest extends \PHPUnit_Framework_TestCase
{
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
$platform
=
$this
->
createMock
(
'Doctrine\DBAL\Platforms\PostgreSqlPlatform'
);
$this
->
connection
=
$this
->
getMockBuilder
(
'Doctrine\DBAL\Connection'
)
->
setConstructorArgs
(
array
(
array
(
'platform'
=>
$platform
),
$driverMock
)
)
->
setConstructorArgs
(
[[
'platform'
=>
$platform
],
$driverMock
]
)
->
getMock
();
$this
->
schemaManager
=
new
PostgreSqlSchemaManager
(
$this
->
connection
,
$platform
);
}
...
...
@@ -36,12 +38,12 @@ class PostgreSQLSchemaManagerTest extends \PHPUnit_Framework_TestCase
$configuration
=
new
Configuration
();
$configuration
->
setFilterSchemaAssetsExpression
(
'/^schema/'
);
$sequences
=
array
(
array
(
'relname'
=>
'foo'
,
'schemaname'
=>
'schema'
)
,
array
(
'relname'
=>
'bar'
,
'schemaname'
=>
'schema'
)
,
array
(
'relname'
=>
'baz'
,
'schemaname'
=>
''
)
,
array
(
'relname'
=>
'bloo'
,
'schemaname'
=>
'bloo_schema'
)
,
)
;
$sequences
=
[
[
'relname'
=>
'foo'
,
'schemaname'
=>
'schema'
]
,
[
'relname'
=>
'bar'
,
'schemaname'
=>
'schema'
]
,
[
'relname'
=>
'baz'
,
'schemaname'
=>
''
]
,
[
'relname'
=>
'bloo'
,
'schemaname'
=>
'bloo_schema'
]
,
]
;
$this
->
connection
->
expects
(
$this
->
any
())
->
method
(
'getConfiguration'
)
...
...
@@ -53,20 +55,20 @@ class PostgreSQLSchemaManagerTest extends \PHPUnit_Framework_TestCase
$this
->
connection
->
expects
(
$this
->
at
(
1
))
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
(
array
(
array
(
'min_value'
=>
1
,
'increment_by'
=>
1
))
));
->
will
(
$this
->
returnValue
(
[[
'min_value'
=>
1
,
'increment_by'
=>
1
]]
));
$this
->
connection
->
expects
(
$this
->
at
(
2
))
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
(
array
(
array
(
'min_value'
=>
2
,
'increment_by'
=>
2
))
));
->
will
(
$this
->
returnValue
(
[[
'min_value'
=>
2
,
'increment_by'
=>
2
]]
));
$this
->
connection
->
expects
(
$this
->
exactly
(
3
))
->
method
(
'fetchAll'
);
$this
->
assertEquals
(
array
(
[
new
Sequence
(
'schema.foo'
,
2
,
2
),
new
Sequence
(
'schema.bar'
,
1
,
1
),
)
,
]
,
$this
->
schemaManager
->
listSequences
(
'database'
)
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment