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
397fe2b9
Unverified
Commit
397fe2b9
authored
May 30, 2019
by
Jonathan H. Wage
Committed by
Sergei Morozov
Dec 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated stuff for 3.0
parent
ef6b84ef
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
106 additions
and
178 deletions
+106
-178
Configuration.php
lib/Doctrine/DBAL/Configuration.php
+0
-32
UnknownFetchMode.php
lib/Doctrine/DBAL/Driver/Exception/UnknownFetchMode.php
+19
-0
UnknownParamType.php
lib/Doctrine/DBAL/Driver/Exception/UnknownParamType.php
+16
-0
UnknownFetchMode.php
...octrine/DBAL/Driver/Mysqli/Exception/UnknownFetchMode.php
+1
-4
PDOStatement.php
lib/Doctrine/DBAL/Driver/PDOStatement.php
+4
-18
SQLSrvStatement.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
+1
-3
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+13
-12
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+2
-2
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+4
-4
SQLParserUtils.php
lib/Doctrine/DBAL/SQLParserUtils.php
+4
-7
Column.php
lib/Doctrine/DBAL/Schema/Column.php
+4
-11
UnknownColumnOption.php
lib/Doctrine/DBAL/Schema/Exception/UnknownColumnOption.php
+18
-0
BinaryType.php
lib/Doctrine/DBAL/Types/BinaryType.php
+1
-1
BlobType.php
lib/Doctrine/DBAL/Types/BlobType.php
+1
-1
Type.php
lib/Doctrine/DBAL/Types/Type.php
+0
-72
Types.php
lib/Doctrine/DBAL/Types/Types.php
+0
-3
PDOStatementTest.php
tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php
+4
-0
PostgreSqlPlatformTest.php
.../Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php
+3
-3
ColumnTest.php
tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php
+6
-1
TableTest.php
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
+5
-4
No files found.
lib/Doctrine/DBAL/Configuration.php
View file @
397fe2b9
...
...
@@ -7,8 +7,6 @@ namespace Doctrine\DBAL;
use
Doctrine\Common\Cache\Cache
;
use
Doctrine\DBAL\Logging\NullLogger
;
use
Doctrine\DBAL\Logging\SQLLogger
;
use
Doctrine\DBAL\Schema\AbstractAsset
;
use
function
preg_match
;
/**
* Configuration container for the Doctrine DBAL.
...
...
@@ -58,36 +56,6 @@ class Configuration
$this
->
_attributes
[
'resultCacheImpl'
]
=
$cacheImpl
;
}
/**
* Sets the filter schema assets expression.
*
* Only include tables/sequences matching the filter expression regexp in
* schema instances generated for the active connection when calling
* {AbstractSchemaManager#createSchema()}.
*
* @deprecated Use Configuration::setSchemaAssetsFilter() instead
*/
public
function
setFilterSchemaAssetsExpression
(
?
string
$filterExpression
)
:
void
{
$this
->
_attributes
[
'filterSchemaAssetsExpression'
]
=
$filterExpression
;
if
(
$filterExpression
)
{
$this
->
_attributes
[
'filterSchemaAssetsExpressionCallable'
]
=
$this
->
buildSchemaAssetsFilterFromExpression
(
$filterExpression
);
}
else
{
$this
->
_attributes
[
'filterSchemaAssetsExpressionCallable'
]
=
null
;
}
}
private
function
buildSchemaAssetsFilterFromExpression
(
string
$filterExpression
)
:
callable
{
return
static
function
(
$assetName
)
use
(
$filterExpression
)
:
bool
{
if
(
$assetName
instanceof
AbstractAsset
)
{
$assetName
=
$assetName
->
getName
();
}
return
preg_match
(
$filterExpression
,
$assetName
)
>
0
;
};
}
/**
* Sets the callable to use to filter schema assets.
*/
...
...
lib/Doctrine/DBAL/Driver/Exception/UnknownFetchMode.php
0 → 100644
View file @
397fe2b9
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\Exception
;
use
Doctrine\DBAL\DBALException
;
use
function
sprintf
;
final
class
UnknownFetchMode
extends
DBALException
{
/**
* @param mixed $fetchMode
*/
public
static
function
new
(
$fetchMode
)
:
self
{
return
new
self
(
sprintf
(
'Unknown fetch mode %d.'
,
$fetchMode
));
}
}
lib/Doctrine/DBAL/Driver/Exception/UnknownParamType.php
0 → 100644
View file @
397fe2b9
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\Exception
;
use
Doctrine\DBAL\DBALException
;
use
function
sprintf
;
final
class
UnknownParamType
extends
DBALException
{
public
static
function
new
(
int
$type
)
:
self
{
return
new
self
(
sprintf
(
'Unknown param type %d.'
,
$type
));
}
}
lib/Doctrine/DBAL/Driver/Mysqli/Exception/UnknownFetchMode.php
View file @
397fe2b9
...
...
@@ -9,10 +9,7 @@ use function sprintf;
final
class
UnknownFetchMode
extends
MysqliException
{
/**
* @param mixed $fetchMode
*/
public
static
function
new
(
$fetchMode
)
:
self
public
static
function
new
(
int
$fetchMode
)
:
self
{
return
new
self
(
sprintf
(
'Unknown fetch mode %d.'
,
$fetchMode
));
}
...
...
lib/Doctrine/DBAL/Driver/PDOStatement.php
View file @
397fe2b9
...
...
@@ -4,19 +4,18 @@ declare(strict_types=1);
namespace
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Driver\Exception\UnknownFetchMode
;
use
Doctrine\DBAL\Driver\Exception\UnknownParamType
;
use
Doctrine\DBAL\Exception\InvalidColumnIndex
;
use
Doctrine\DBAL\FetchMode
;
use
Doctrine\DBAL\ParameterType
;
use
IteratorAggregate
;
use
PDO
;
use
const
E_USER_DEPRECATED
;
use
function
array_slice
;
use
function
assert
;
use
function
count
;
use
function
func_get_args
;
use
function
is_array
;
use
function
sprintf
;
use
function
trigger_error
;
/**
* The PDO implementation of the Statement interface.
...
...
@@ -204,13 +203,7 @@ class PDOStatement implements IteratorAggregate, Statement
private
function
convertParamType
(
int
$type
)
:
int
{
if
(
!
isset
(
self
::
PARAM_TYPE_MAP
[
$type
]))
{
// TODO: next major: throw an exception
@
trigger_error
(
sprintf
(
'Using a PDO parameter type (%d given) is deprecated and will cause an error in Doctrine DBAL 3.0.'
,
$type
),
E_USER_DEPRECATED
);
return
$type
;
throw
UnknownParamType
::
new
(
$type
);
}
return
self
::
PARAM_TYPE_MAP
[
$type
];
...
...
@@ -224,14 +217,7 @@ class PDOStatement implements IteratorAggregate, Statement
private
function
convertFetchMode
(
int
$fetchMode
)
:
int
{
if
(
!
isset
(
self
::
FETCH_MODE_MAP
[
$fetchMode
]))
{
// TODO: next major: throw an exception
@
trigger_error
(
sprintf
(
'Using a PDO fetch mode or their combination (%d given)'
.
' is deprecated and will cause an error in Doctrine DBAL 3.0.'
,
$fetchMode
),
E_USER_DEPRECATED
);
return
$fetchMode
;
throw
UnknownFetchMode
::
new
(
$fetchMode
);
}
return
self
::
FETCH_MODE_MAP
[
$fetchMode
];
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
View file @
397fe2b9
...
...
@@ -122,10 +122,8 @@ class SQLSrvStatement implements IteratorAggregate, Statement
/**
* Append to any INSERT query to retrieve the last insert id.
*
* @deprecated This constant has been deprecated and will be made private in 3.0
*/
p
ublic
const
LAST_INSERT_ID_SQL
=
';SELECT SCOPE_IDENTITY() AS LastInsertId;'
;
p
rivate
const
LAST_INSERT_ID_SQL
=
';SELECT SCOPE_IDENTITY() AS LastInsertId;'
;
/**
* @param resource $conn
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
397fe2b9
...
...
@@ -2089,7 +2089,7 @@ abstract class AbstractPlatform
$chunks
[]
=
'CLUSTERED'
;
}
$chunks
[]
=
sprintf
(
'(%s)'
,
$this
->
get
Index
FieldDeclarationListSQL
(
$columns
));
$chunks
[]
=
sprintf
(
'(%s)'
,
$this
->
get
Columns
FieldDeclarationListSQL
(
$columns
));
return
implode
(
' '
,
$chunks
);
}
...
...
@@ -2134,22 +2134,23 @@ abstract class AbstractPlatform
/**
* Obtains DBMS specific SQL code portion needed to set an index
* declaration to be used in statements like CREATE TABLE.
*
* @param mixed[]|Index $columnsOrIndex array declaration is deprecated, prefer passing Index to this method
*/
public
function
getIndexFieldDeclarationListSQL
(
$columnsOrI
ndex
)
:
string
public
function
getIndexFieldDeclarationListSQL
(
Index
$i
ndex
)
:
string
{
if
(
$columnsOrIndex
instanceof
Index
)
{
return
implode
(
', '
,
$columnsOrIndex
->
getQuotedColumns
(
$this
));
}
if
(
!
is_array
(
$columnsOrIndex
))
{
throw
new
InvalidArgumentException
(
'Fields argument should be an Index or array.'
);
return
implode
(
', '
,
$index
->
getQuotedColumns
(
$this
));
}
/**
* Obtains DBMS specific SQL code portion needed to set an index
* declaration to be used in statements like CREATE TABLE.
*
* @param mixed[] $columns
*/
public
function
getColumnsFieldDeclarationListSQL
(
array
$columns
)
:
string
{
$ret
=
[];
foreach
(
$columns
OrIndex
as
$column
=>
$definition
)
{
foreach
(
$columns
as
$column
=>
$definition
)
{
if
(
is_array
(
$definition
))
{
$ret
[]
=
$column
;
}
else
{
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
397fe2b9
...
...
@@ -1135,8 +1135,8 @@ SQL
'int8'
=>
'bigint'
,
'integer'
=>
'integer'
,
'interval'
=>
'string'
,
'json'
=>
Type
::
JSON
,
'jsonb'
=>
Type
::
JSON
,
'json'
=>
'json'
,
'jsonb'
=>
'json'
,
'money'
=>
'decimal'
,
'numeric'
=>
'decimal'
,
'serial'
=>
'integer'
,
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
397fe2b9
...
...
@@ -584,9 +584,9 @@ class SQLAnywherePlatform extends AbstractPlatform
}
return
$sql
.
'FOREIGN KEY ('
.
$this
->
get
Index
FieldDeclarationListSQL
(
$localColumns
)
.
') '
.
'FOREIGN KEY ('
.
$this
->
get
Columns
FieldDeclarationListSQL
(
$localColumns
)
.
') '
.
'REFERENCES '
.
$foreignKey
->
getQuotedForeignTableName
(
$this
)
.
' ('
.
$this
->
get
Index
FieldDeclarationListSQL
(
$foreignColumns
)
.
')'
;
' ('
.
$this
->
get
Columns
FieldDeclarationListSQL
(
$foreignColumns
)
.
')'
;
}
/**
...
...
@@ -1419,10 +1419,10 @@ SQL
}
if
(
$constraint
->
isPrimary
())
{
return
$sql
.
'PRIMARY KEY '
.
$flags
.
'('
.
$this
->
get
Index
FieldDeclarationListSQL
(
$constraintColumns
)
.
')'
;
return
$sql
.
'PRIMARY KEY '
.
$flags
.
'('
.
$this
->
get
Columns
FieldDeclarationListSQL
(
$constraintColumns
)
.
')'
;
}
return
$sql
.
'UNIQUE '
.
$flags
.
'('
.
$this
->
get
Index
FieldDeclarationListSQL
(
$constraintColumns
)
.
')'
;
return
$sql
.
'UNIQUE '
.
$flags
.
'('
.
$this
->
get
Columns
FieldDeclarationListSQL
(
$constraintColumns
)
.
')'
;
}
/**
...
...
lib/Doctrine/DBAL/SQLParserUtils.php
View file @
397fe2b9
...
...
@@ -33,15 +33,12 @@ class SQLParserUtils
/**#@+
* Quote characters within string literals can be preceded by a backslash.
*
* @deprecated Will be removed as internal implementation details.
*/
public
const
ESCAPED_SINGLE_QUOTED_TEXT
=
"(?:'(?:
\\\\
)+'|'(?:[^'
\\\\
]|
\\\\
'?|'')*')"
;
public
const
ESCAPED_DOUBLE_QUOTED_TEXT
=
'(?:"(?:\\\\)+"|"(?:[^"\\\\]|\\\\"?)*")'
;
public
const
ESCAPED_BACKTICK_QUOTED_TEXT
=
'(?:`(?:\\\\)+`|`(?:[^`\\\\]|\\\\`?)*`)'
;
/**#@-*/
private
const
ESCAPED_SINGLE_QUOTED_TEXT
=
"(?:'(?:
\\\\
)+'|'(?:[^'
\\\\
]|
\\\\
'?|'')*')"
;
private
const
ESCAPED_DOUBLE_QUOTED_TEXT
=
'(?:"(?:\\\\)+"|"(?:[^"\\\\]|\\\\"?)*")'
;
private
const
ESCAPED_BACKTICK_QUOTED_TEXT
=
'(?:`(?:\\\\)+`|`(?:[^`\\\\]|\\\\`?)*`)'
;
private
const
ESCAPED_BRACKET_QUOTED_TEXT
=
'(?<!\b(?i:ARRAY))\[(?:[^\]])*\]'
;
/**#@-*/
/**
* Returns a zero-indexed list of placeholder position.
...
...
lib/Doctrine/DBAL/Schema/Column.php
View file @
397fe2b9
...
...
@@ -4,12 +4,10 @@ declare(strict_types=1);
namespace
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Schema\Exception\UnknownColumnOption
;
use
Doctrine\DBAL\Types\Type
;
use
const
E_USER_DEPRECATED
;
use
function
array_merge
;
use
function
method_exists
;
use
function
sprintf
;
use
function
trigger_error
;
/**
* Object representation of a database column.
...
...
@@ -74,16 +72,11 @@ class Column extends AbstractAsset
{
foreach
(
$options
as
$name
=>
$value
)
{
$method
=
'set'
.
$name
;
if
(
!
method_exists
(
$this
,
$method
))
{
// next major: throw an exception
@
trigger_error
(
sprintf
(
'The "%s" column option is not supported,'
.
' setting it is deprecated and will cause an error in Doctrine DBAL 3.0'
,
$name
),
E_USER_DEPRECATED
);
continue
;
if
(
!
method_exists
(
$this
,
$method
))
{
throw
UnknownColumnOption
::
new
(
$name
);
}
$this
->
$method
(
$value
);
}
...
...
lib/Doctrine/DBAL/Schema/Exception/UnknownColumnOption.php
0 → 100644
View file @
397fe2b9
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Schema\Exception
;
use
Doctrine\DBAL\Schema\SchemaException
;
use
function
sprintf
;
final
class
UnknownColumnOption
extends
SchemaException
{
public
static
function
new
(
string
$name
)
:
self
{
return
new
self
(
sprintf
(
'The "%s" column option is not supported.'
,
$name
)
);
}
}
lib/Doctrine/DBAL/Types/BinaryType.php
View file @
397fe2b9
...
...
@@ -38,7 +38,7 @@ class BinaryType extends Type
}
if
(
!
is_string
(
$value
))
{
throw
ValueNotConvertible
::
new
(
$value
,
self
::
BINARY
);
throw
ValueNotConvertible
::
new
(
$value
,
Types
::
BINARY
);
}
return
$value
;
...
...
lib/Doctrine/DBAL/Types/BlobType.php
View file @
397fe2b9
...
...
@@ -45,7 +45,7 @@ class BlobType extends Type
}
if
(
!
is_resource
(
$value
))
{
throw
ValueNotConvertible
::
new
(
$value
,
self
::
BLOB
);
throw
ValueNotConvertible
::
new
(
$value
,
Types
::
BLOB
);
}
return
$value
;
...
...
lib/Doctrine/DBAL/Types/Type.php
View file @
397fe2b9
...
...
@@ -17,78 +17,6 @@ use function get_class;
*/
abstract
class
Type
{
/** @deprecated Use {@see Types::BIGINT} instead. */
public
const
BIGINT
=
Types
::
BIGINT
;
/** @deprecated Use {@see Types::BINARY} instead. */
public
const
BINARY
=
Types
::
BINARY
;
/** @deprecated Use {@see Types::BLOB} instead. */
public
const
BLOB
=
Types
::
BLOB
;
/** @deprecated Use {@see Types::BOOLEAN} instead. */
public
const
BOOLEAN
=
Types
::
BOOLEAN
;
/** @deprecated Use {@see Types::DATE_MUTABLE} instead. */
public
const
DATE
=
Types
::
DATE_MUTABLE
;
/** @deprecated Use {@see Types::DATE_IMMUTABLE} instead. */
public
const
DATE_IMMUTABLE
=
Types
::
DATE_IMMUTABLE
;
/** @deprecated Use {@see Types::DATEINTERVAL} instead. */
public
const
DATEINTERVAL
=
Types
::
DATEINTERVAL
;
/** @deprecated Use {@see Types::DATETIME_MUTABLE} instead. */
public
const
DATETIME
=
Types
::
DATETIME_MUTABLE
;
/** @deprecated Use {@see Types::DATETIME_IMMUTABLE} instead. */
public
const
DATETIME_IMMUTABLE
=
Types
::
DATETIME_IMMUTABLE
;
/** @deprecated Use {@see Types::DATETIMETZ_MUTABLE} instead. */
public
const
DATETIMETZ
=
Types
::
DATETIMETZ_MUTABLE
;
/** @deprecated Use {@see Types::DATETIMETZ_IMMUTABLE} instead. */
public
const
DATETIMETZ_IMMUTABLE
=
Types
::
DATETIMETZ_IMMUTABLE
;
/** @deprecated Use {@see Types::DECIMAL} instead. */
public
const
DECIMAL
=
Types
::
DECIMAL
;
/** @deprecated Use {@see Types::FLOAT} instead. */
public
const
FLOAT
=
Types
::
FLOAT
;
/** @deprecated Use {@see Types::GUID} instead. */
public
const
GUID
=
Types
::
GUID
;
/** @deprecated Use {@see Types::INTEGER} instead. */
public
const
INTEGER
=
Types
::
INTEGER
;
/** @deprecated Use {@see Types::JSON} instead. */
public
const
JSON
=
Types
::
JSON
;
/** @deprecated Use {@see Types::OBJECT} instead. */
public
const
OBJECT
=
Types
::
OBJECT
;
/** @deprecated Use {@see Types::SIMPLE_ARRAY} instead. */
public
const
SIMPLE_ARRAY
=
Types
::
SIMPLE_ARRAY
;
/** @deprecated Use {@see Types::SMALLINT} instead. */
public
const
SMALLINT
=
Types
::
SMALLINT
;
/** @deprecated Use {@see Types::STRING} instead. */
public
const
STRING
=
Types
::
STRING
;
/** @deprecated Use {@see Types::ARRAY} instead. */
public
const
TARRAY
=
Types
::
ARRAY
;
/** @deprecated Use {@see Types::TEXT} instead. */
public
const
TEXT
=
Types
::
TEXT
;
/** @deprecated Use {@see Types::TIME_MUTABLE} instead. */
public
const
TIME
=
Types
::
TIME_MUTABLE
;
/** @deprecated Use {@see Types::TIME_IMMUTABLE} instead. */
public
const
TIME_IMMUTABLE
=
Types
::
TIME_IMMUTABLE
;
/**
* The map of supported doctrine mapping types.
*/
...
...
lib/Doctrine/DBAL/Types/Types.php
View file @
397fe2b9
...
...
@@ -34,9 +34,6 @@ final class Types
public
const
TIME_MUTABLE
=
'time'
;
public
const
TIME_IMMUTABLE
=
'time_immutable'
;
/** @deprecated json_array type is deprecated, use {@see self::JSON} instead. */
public
const
JSON_ARRAY
=
'json_array'
;
private
function
__construct
()
{
}
...
...
tests/Doctrine/Tests/DBAL/Functional/PDOStatementTest.php
View file @
397fe2b9
...
...
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace
Doctrine\Tests\DBAL\Functional
;
use
Doctrine\DBAL\Driver\Exception\UnknownFetchMode
;
use
Doctrine\DBAL\Driver\PDOConnection
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
...
...
@@ -39,6 +40,9 @@ class PDOStatementTest extends DbalFunctionalTestCase
'name'
=>
'Bob'
,
]);
self
::
expectException
(
UnknownFetchMode
::
class
);
self
::
expectExceptionMessage
(
'Unknown fetch mode 12.'
);
$data
=
$this
->
connection
->
query
(
'SELECT id, name FROM stmt_test ORDER BY id'
)
->
fetchAll
(
PDO
::
FETCH_KEY_PAIR
);
...
...
tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php
View file @
397fe2b9
...
...
@@ -7,7 +7,7 @@ namespace Doctrine\Tests\DBAL\Platforms;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Type
s
;
use
function
assert
;
class
PostgreSqlPlatformTest
extends
AbstractPostgreSqlPlatformTestCase
...
...
@@ -87,9 +87,9 @@ class PostgreSqlPlatformTest extends AbstractPostgreSqlPlatformTestCase
public
function
testInitializesJsonTypeMapping
()
:
void
{
self
::
assertTrue
(
$this
->
platform
->
hasDoctrineTypeMappingFor
(
'json'
));
self
::
assertEquals
(
Type
::
JSON
,
$this
->
platform
->
getDoctrineTypeMapping
(
'json'
));
self
::
assertEquals
(
Type
s
::
JSON
,
$this
->
platform
->
getDoctrineTypeMapping
(
'json'
));
self
::
assertTrue
(
$this
->
platform
->
hasDoctrineTypeMappingFor
(
'jsonb'
));
self
::
assertEquals
(
Type
::
JSON
,
$this
->
platform
->
getDoctrineTypeMapping
(
'jsonb'
));
self
::
assertEquals
(
Type
s
::
JSON
,
$this
->
platform
->
getDoctrineTypeMapping
(
'jsonb'
));
}
/**
...
...
tests/Doctrine/Tests/DBAL/Schema/ColumnTest.php
View file @
397fe2b9
...
...
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
use
Doctrine\DBAL\Platforms\SQLServerPlatform
;
use
Doctrine\DBAL\Schema\Column
;
use
Doctrine\DBAL\Schema\Exception\UnknownColumnOption
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Types
;
use
PHPUnit\Framework\TestCase
;
...
...
@@ -64,13 +65,17 @@ class ColumnTest extends TestCase
public
function
testSettingUnknownOptionIsStillSupported
()
:
void
{
$this
->
expectNotToPerformAssertions
();
self
::
expectException
(
UnknownColumnOption
::
class
);
self
::
expectExceptionMessage
(
'The "unknown_option" column option is not supported.'
);
new
Column
(
'foo'
,
$this
->
createMock
(
Type
::
class
),
[
'unknown_option'
=>
'bar'
]);
}
public
function
testOptionsShouldNotBeIgnored
()
:
void
{
self
::
expectException
(
UnknownColumnOption
::
class
);
self
::
expectExceptionMessage
(
'The "unknown_option" column option is not supported.'
);
$col1
=
new
Column
(
'bar'
,
Type
::
getType
(
Types
::
INTEGER
),
[
'unknown_option'
=>
'bar'
,
'notnull'
=>
true
]);
self
::
assertTrue
(
$col1
->
getNotnull
());
...
...
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
View file @
397fe2b9
...
...
@@ -14,6 +14,7 @@ use Doctrine\DBAL\Schema\SchemaException;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\UniqueConstraint
;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Types
;
use
Doctrine\Tests\DbalTestCase
;
use
function
array_keys
;
use
function
current
;
...
...
@@ -905,10 +906,10 @@ class TableTest extends DbalTestCase
public
function
testUniqueConstraintWithEmptyName
()
:
void
{
$columns
=
[
new
Column
(
'column1'
,
Type
::
getType
(
Type
::
STRING
)),
new
Column
(
'column2'
,
Type
::
getType
(
Type
::
STRING
)),
new
Column
(
'column3'
,
Type
::
getType
(
Type
::
STRING
)),
new
Column
(
'column4'
,
Type
::
getType
(
Type
::
STRING
)),
new
Column
(
'column1'
,
Type
::
getType
(
Type
s
::
STRING
)),
new
Column
(
'column2'
,
Type
::
getType
(
Type
s
::
STRING
)),
new
Column
(
'column3'
,
Type
::
getType
(
Type
s
::
STRING
)),
new
Column
(
'column4'
,
Type
::
getType
(
Type
s
::
STRING
)),
];
$uniqueConstraints
=
[
...
...
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