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
b066e54f
Commit
b066e54f
authored
Dec 19, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all trailing whitespaces
parent
2e02241c
Changes
82
Hide whitespace changes
Inline
Side-by-side
Showing
82 changed files
with
328 additions
and
329 deletions
+328
-329
QueryCacheProfile.php
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
+1
-1
ResultCacheStatement.php
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
+2
-2
Configuration.php
lib/Doctrine/DBAL/Configuration.php
+2
-2
ConnectionException.php
lib/Doctrine/DBAL/ConnectionException.php
+1
-1
Connection.php
lib/Doctrine/DBAL/Driver/Connection.php
+1
-1
DB2Driver.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
+1
-1
DB2Exception.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php
+1
-1
MysqliStatement.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
+1
-1
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+6
-6
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
+1
-1
Connection.php
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
+2
-2
Driver.php
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
+5
-5
Statement.php
lib/Doctrine/DBAL/Driver/Statement.php
+7
-7
SchemaAlterTableChangeColumnEventArgs.php
...rine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
+1
-1
SchemaCreateTableEventArgs.php
lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php
+1
-1
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+1
-1
DB2Keywords.php
lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
+2
-3
KeywordList.php
lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php
+8
-8
MsSQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
+1
-1
MySQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
+1
-1
OracleKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
+1
-1
PostgreSQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php
+1
-1
ReservedKeywordsValidator.php
...ine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
+11
-11
SQLiteKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
+1
-1
MsSqlPlatform.php
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
+2
-2
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+1
-1
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+2
-2
Connection.php
lib/Doctrine/DBAL/Portability/Connection.php
+11
-11
Statement.php
lib/Doctrine/DBAL/Portability/Statement.php
+1
-1
CompositeExpression.php
lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php
+22
-22
ExpressionBuilder.php
lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php
+10
-10
SQLParserUtils.php
lib/Doctrine/DBAL/SQLParserUtils.php
+22
-22
AbstractSchemaManager.php
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
+5
-5
Column.php
lib/Doctrine/DBAL/Schema/Column.php
+1
-1
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+3
-3
DB2SchemaManager.php
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
+2
-2
Index.php
lib/Doctrine/DBAL/Schema/Index.php
+2
-2
OracleSchemaManager.php
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
+1
-1
Schema.php
lib/Doctrine/DBAL/Schema/Schema.php
+6
-6
Sequence.php
lib/Doctrine/DBAL/Schema/Sequence.php
+1
-1
SqliteSchemaManager.php
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
+2
-2
CreateSchemaSqlCollector.php
...Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+2
-2
ReservedWordsCommand.php
...trine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
+12
-12
BooleanType.php
lib/Doctrine/DBAL/Types/BooleanType.php
+1
-1
ConversionException.php
lib/Doctrine/DBAL/Types/ConversionException.php
+3
-3
DateTimeType.php
lib/Doctrine/DBAL/Types/DateTimeType.php
+1
-1
DateTimeTzType.php
lib/Doctrine/DBAL/Types/DateTimeTzType.php
+1
-1
DateType.php
lib/Doctrine/DBAL/Types/DateType.php
+2
-2
TimeType.php
lib/Doctrine/DBAL/Types/TimeType.php
+1
-1
Version.php
lib/Doctrine/DBAL/Version.php
+2
-2
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+1
-1
OCI8StatementTest.php
tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php
+4
-4
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+1
-1
ConnectionTest.php
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
+4
-4
ResultCacheTest.php
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
+1
-1
MsSqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MsSqlSchemaManagerTest.php
+2
-2
MySqlSchemaManagerTest.php
...e/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
+2
-2
OracleSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
+1
-1
SqliteSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
+1
-1
TemporaryTableTest.php
tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php
+1
-1
TypeConversionTest.php
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
+1
-1
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+3
-3
MySqlPlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php
+8
-8
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+6
-6
PostgreSqlPlatformTest.php
.../Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php
+1
-1
ReservedKeywordsValidatorTest.php
...ne/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php
+6
-6
SqlitePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
+5
-5
CompositeExpressionTest.php
...e/Tests/DBAL/Query/Expression/CompositeExpressionTest.php
+20
-20
ExpressionBuilderTest.php
...ine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php
+38
-38
SQLParserUtilsTest.php
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
+8
-8
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+10
-10
ArrayTest.php
tests/Doctrine/Tests/DBAL/Types/ArrayTest.php
+1
-1
BooleanTest.php
tests/Doctrine/Tests/DBAL/Types/BooleanTest.php
+1
-1
DateTest.php
tests/Doctrine/Tests/DBAL/Types/DateTest.php
+2
-2
DecimalTest.php
tests/Doctrine/Tests/DBAL/Types/DecimalTest.php
+1
-1
ObjectTest.php
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
+1
-1
SmallIntTest.php
tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php
+1
-1
StringTest.php
tests/Doctrine/Tests/DBAL/Types/StringTest.php
+1
-1
TimeTest.php
tests/Doctrine/Tests/DBAL/Types/TimeTest.php
+1
-1
DriverMock.php
tests/Doctrine/Tests/Mocks/DriverMock.php
+1
-1
HydratorMockStatement.php
tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
+14
-14
SchemaManagerMock.php
tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
+1
-1
No files found.
lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
View file @
b066e54f
...
@@ -84,7 +84,7 @@ class QueryCacheProfile
...
@@ -84,7 +84,7 @@ class QueryCacheProfile
/**
/**
* Generate the real cache key from query, params and types.
* Generate the real cache key from query, params and types.
*
*
* @param string $query
* @param string $query
* @param array $params
* @param array $params
* @param array $types
* @param array $types
...
...
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
View file @
b066e54f
...
@@ -68,7 +68,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -68,7 +68,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
/**
/**
* Did we reach the end of the statement?
* Did we reach the end of the statement?
*
*
* @var bool
* @var bool
*/
*/
private
$emptied
=
false
;
private
$emptied
=
false
;
...
@@ -179,7 +179,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -179,7 +179,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
$row
=
$this
->
statement
->
fetch
(
PDO
::
FETCH_ASSOC
);
$row
=
$this
->
statement
->
fetch
(
PDO
::
FETCH_ASSOC
);
if
(
$row
)
{
if
(
$row
)
{
$this
->
data
[]
=
$row
;
$this
->
data
[]
=
$row
;
if
(
$fetchStyle
==
PDO
::
FETCH_ASSOC
)
{
if
(
$fetchStyle
==
PDO
::
FETCH_ASSOC
)
{
return
$row
;
return
$row
;
}
else
if
(
$fetchStyle
==
PDO
::
FETCH_NUM
)
{
}
else
if
(
$fetchStyle
==
PDO
::
FETCH_NUM
)
{
...
...
lib/Doctrine/DBAL/Configuration.php
View file @
b066e54f
<?php
<?php
/*
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
...
@@ -54,7 +54,7 @@ class Configuration
...
@@ -54,7 +54,7 @@ class Configuration
/**
/**
* Gets the SQL logger that is used.
* Gets the SQL logger that is used.
*
*
* @return SQLLogger
* @return SQLLogger
*/
*/
public
function
getSQLLogger
()
public
function
getSQLLogger
()
...
...
lib/Doctrine/DBAL/ConnectionException.php
View file @
b066e54f
...
@@ -36,7 +36,7 @@ class ConnectionException extends DBALException
...
@@ -36,7 +36,7 @@ class ConnectionException extends DBALException
{
{
return
new
self
(
"Transaction commit failed because the transaction has been marked for rollback only."
);
return
new
self
(
"Transaction commit failed because the transaction has been marked for rollback only."
);
}
}
public
static
function
noActiveTransaction
()
public
static
function
noActiveTransaction
()
{
{
return
new
self
(
"There is no active transaction."
);
return
new
self
(
"There is no active transaction."
);
...
...
lib/Doctrine/DBAL/Driver/Connection.php
View file @
b066e54f
...
@@ -24,7 +24,7 @@ namespace Doctrine\DBAL\Driver;
...
@@ -24,7 +24,7 @@ namespace Doctrine\DBAL\Driver;
* Driver connections must implement this interface.
* Driver connections must implement this interface.
*
*
* This resembles (a subset of) the PDO interface.
* This resembles (a subset of) the PDO interface.
*
*
* @since 2.0
* @since 2.0
*/
*/
interface
Connection
interface
Connection
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Driver.php
View file @
b066e54f
...
@@ -42,7 +42,7 @@ class DB2Driver implements Driver
...
@@ -42,7 +42,7 @@ class DB2Driver implements Driver
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
{
{
if
(
!
isset
(
$params
[
'schema'
])
)
{
if
(
!
isset
(
$params
[
'schema'
])
)
{
}
}
if
(
$params
[
'host'
]
!==
'localhost'
&&
$params
[
'host'
]
!=
'127.0.0.1'
)
{
if
(
$params
[
'host'
]
!==
'localhost'
&&
$params
[
'host'
]
!=
'127.0.0.1'
)
{
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Exception.php
View file @
b066e54f
...
@@ -23,5 +23,5 @@ namespace Doctrine\DBAL\Driver\IBMDB2;
...
@@ -23,5 +23,5 @@ namespace Doctrine\DBAL\Driver\IBMDB2;
class
DB2Exception
extends
\Exception
class
DB2Exception
extends
\Exception
{
{
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View file @
b066e54f
...
@@ -179,7 +179,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
...
@@ -179,7 +179,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
/**
/**
* Bind a array of values to bound parameters
* Bind a array of values to bound parameters
*
*
* @param array $values
* @param array $values
* @return boolean
* @return boolean
*/
*/
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
b066e54f
...
@@ -32,7 +32,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -32,7 +32,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
/**
/**
* Create a Connection to an Oracle Database using oci8 extension.
* Create a Connection to an Oracle Database using oci8 extension.
*
*
* @param string $username
* @param string $username
* @param string $password
* @param string $password
* @param string $db
* @param string $db
...
@@ -51,7 +51,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -51,7 +51,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
/**
/**
* Create a non-executed prepared statement.
* Create a non-executed prepared statement.
*
*
* @param string $prepareString
* @param string $prepareString
* @return OCI8Statement
* @return OCI8Statement
*/
*/
...
@@ -78,7 +78,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -78,7 +78,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
* Quote input value.
* Quote input value.
*
*
* @param mixed $input
* @param mixed $input
* @param int $type PDO::PARAM*
* @param int $type PDO::PARAM*
* @return mixed
* @return mixed
*/
*/
public
function
quote
(
$value
,
$type
=
\PDO
::
PARAM_STR
)
public
function
quote
(
$value
,
$type
=
\PDO
::
PARAM_STR
)
...
@@ -101,7 +101,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -101,7 +101,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
$stmt
->
execute
();
$stmt
->
execute
();
return
$stmt
->
rowCount
();
return
$stmt
->
rowCount
();
}
}
public
function
lastInsertId
(
$name
=
null
)
public
function
lastInsertId
(
$name
=
null
)
{
{
//TODO: throw exception or support sequences?
//TODO: throw exception or support sequences?
...
@@ -147,7 +147,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -147,7 +147,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
$this
->
_executeMode
=
OCI_COMMIT_ON_SUCCESS
;
$this
->
_executeMode
=
OCI_COMMIT_ON_SUCCESS
;
return
true
;
return
true
;
}
}
public
function
errorCode
()
public
function
errorCode
()
{
{
$error
=
oci_error
(
$this
->
_dbh
);
$error
=
oci_error
(
$this
->
_dbh
);
...
@@ -156,7 +156,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -156,7 +156,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
}
}
return
$error
;
return
$error
;
}
}
public
function
errorInfo
()
public
function
errorInfo
()
{
{
return
oci_error
(
$this
->
_dbh
);
return
oci_error
(
$this
->
_dbh
);
...
...
lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php
View file @
b066e54f
...
@@ -80,7 +80,7 @@ class Driver implements \Doctrine\DBAL\Driver
...
@@ -80,7 +80,7 @@ class Driver implements \Doctrine\DBAL\Driver
}
else
if
(
isset
(
$params
[
'memory'
]))
{
}
else
if
(
isset
(
$params
[
'memory'
]))
{
$dsn
.=
':memory:'
;
$dsn
.=
':memory:'
;
}
}
return
$dsn
;
return
$dsn
;
}
}
...
...
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
View file @
b066e54f
...
@@ -34,12 +34,12 @@ class Connection extends \Doctrine\DBAL\Driver\PDOConnection implements \Doctrin
...
@@ -34,12 +34,12 @@ class Connection extends \Doctrine\DBAL\Driver\PDOConnection implements \Doctrin
public
function
quote
(
$value
,
$type
=
\PDO
::
PARAM_STR
)
public
function
quote
(
$value
,
$type
=
\PDO
::
PARAM_STR
)
{
{
$val
=
parent
::
quote
(
$value
,
$type
);
$val
=
parent
::
quote
(
$value
,
$type
);
// Fix for a driver version terminating all values with null byte
// Fix for a driver version terminating all values with null byte
if
(
strpos
(
$val
,
"
\0
"
)
!==
false
)
{
if
(
strpos
(
$val
,
"
\0
"
)
!==
false
)
{
$val
=
substr
(
$val
,
0
,
-
1
);
$val
=
substr
(
$val
,
0
,
-
1
);
}
}
return
$val
;
return
$val
;
}
}
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Driver/PDOSqlsrv/Driver.php
View file @
b066e54f
...
@@ -29,7 +29,7 @@ namespace Doctrine\DBAL\Driver\PDOSqlsrv;
...
@@ -29,7 +29,7 @@ namespace Doctrine\DBAL\Driver\PDOSqlsrv;
class
Driver
implements
\Doctrine\DBAL\Driver
class
Driver
implements
\Doctrine\DBAL\Driver
{
{
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
{
{
return
new
Connection
(
return
new
Connection
(
$this
->
_constructPdoDsn
(
$params
),
$this
->
_constructPdoDsn
(
$params
),
$username
,
$username
,
...
@@ -46,19 +46,19 @@ class Driver implements \Doctrine\DBAL\Driver
...
@@ -46,19 +46,19 @@ class Driver implements \Doctrine\DBAL\Driver
private
function
_constructPdoDsn
(
array
$params
)
private
function
_constructPdoDsn
(
array
$params
)
{
{
$dsn
=
'sqlsrv:server='
;
$dsn
=
'sqlsrv:server='
;
if
(
isset
(
$params
[
'host'
]))
{
if
(
isset
(
$params
[
'host'
]))
{
$dsn
.=
$params
[
'host'
];
$dsn
.=
$params
[
'host'
];
}
}
if
(
isset
(
$params
[
'port'
])
&&
!
empty
(
$params
[
'port'
]))
{
if
(
isset
(
$params
[
'port'
])
&&
!
empty
(
$params
[
'port'
]))
{
$dsn
.=
','
.
$params
[
'port'
];
$dsn
.=
','
.
$params
[
'port'
];
}
}
if
(
isset
(
$params
[
'dbname'
]))
{
if
(
isset
(
$params
[
'dbname'
]))
{
$dsn
.=
';Database='
.
$params
[
'dbname'
];
$dsn
.=
';Database='
.
$params
[
'dbname'
];
}
}
return
$dsn
;
return
$dsn
;
}
}
...
...
lib/Doctrine/DBAL/Driver/Statement.php
View file @
b066e54f
...
@@ -24,9 +24,9 @@ use \PDO;
...
@@ -24,9 +24,9 @@ use \PDO;
/**
/**
* Statement interface.
* Statement interface.
* Drivers must implement this interface.
* Drivers must implement this interface.
*
*
* This resembles (a subset of) the PDOStatement interface.
* This resembles (a subset of) the PDOStatement interface.
*
*
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
...
@@ -51,13 +51,13 @@ interface Statement extends ResultStatement
...
@@ -51,13 +51,13 @@ interface Statement extends ResultStatement
function
bindValue
(
$param
,
$value
,
$type
=
null
);
function
bindValue
(
$param
,
$value
,
$type
=
null
);
/**
/**
* Binds a PHP variable to a corresponding named or question mark placeholder in the
* Binds a PHP variable to a corresponding named or question mark placeholder in the
* SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(),
* SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(),
* the variable is bound as a reference and will only be evaluated at the time
* the variable is bound as a reference and will only be evaluated at the time
* that PDOStatement->execute() is called.
* that PDOStatement->execute() is called.
*
*
* Most parameters are input parameters, that is, parameters that are
* Most parameters are input parameters, that is, parameters that are
* used in a read-only fashion to build up the query. Some drivers support the invocation
* used in a read-only fashion to build up the query. Some drivers support the invocation
* of stored procedures that return data as output parameters, and some also as input/output
* of stored procedures that return data as output parameters, and some also as input/output
* parameters that both send in data and are updated to receive it.
* parameters that both send in data and are updated to receive it.
*
*
...
@@ -76,7 +76,7 @@ interface Statement extends ResultStatement
...
@@ -76,7 +76,7 @@ interface Statement extends ResultStatement
/**
/**
* errorCode
* errorCode
* Fetch the SQLSTATE associated with the last operation on the statement handle
* Fetch the SQLSTATE associated with the last operation on the statement handle
*
*
* @see Doctrine_Adapter_Interface::errorCode()
* @see Doctrine_Adapter_Interface::errorCode()
* @return string error code string
* @return string error code string
...
...
lib/Doctrine/DBAL/Event/SchemaAlterTableChangeColumnEventArgs.php
View file @
b066e54f
...
@@ -56,7 +56,7 @@ class SchemaAlterTableChangeColumnEventArgs extends SchemaEventArgs
...
@@ -56,7 +56,7 @@ class SchemaAlterTableChangeColumnEventArgs extends SchemaEventArgs
/**
/**
* @param \Doctrine\DBAL\Schema\ColumnDiff $columnDiff
* @param \Doctrine\DBAL\Schema\ColumnDiff $columnDiff
* @param \Doctrine\DBAL\Schema\TableDiff $tableDiff
* @param \Doctrine\DBAL\Schema\TableDiff $tableDiff
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
*/
*/
public
function
__construct
(
ColumnDiff
$columnDiff
,
TableDiff
$tableDiff
,
AbstractPlatform
$platform
)
public
function
__construct
(
ColumnDiff
$columnDiff
,
TableDiff
$tableDiff
,
AbstractPlatform
$platform
)
{
{
...
...
lib/Doctrine/DBAL/Event/SchemaCreateTableEventArgs.php
View file @
b066e54f
...
@@ -51,7 +51,7 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
...
@@ -51,7 +51,7 @@ class SchemaCreateTableEventArgs extends SchemaEventArgs
* @var \Doctrine\DBAL\Platforms\AbstractPlatform
* @var \Doctrine\DBAL\Platforms\AbstractPlatform
*/
*/
private
$_platform
=
null
;
private
$_platform
=
null
;
/**
/**
* @var array
* @var array
*/
*/
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
b066e54f
...
@@ -412,7 +412,7 @@ abstract class AbstractPlatform
...
@@ -412,7 +412,7 @@ abstract class AbstractPlatform
{
{
throw
DBALException
::
notSupported
(
__METHOD__
);
throw
DBALException
::
notSupported
(
__METHOD__
);
}
}
/**
/**
* Returns global unique identifier
* Returns global unique identifier
*
*
...
...
lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
View file @
b066e54f
...
@@ -34,7 +34,7 @@ class DB2Keywords extends KeywordList
...
@@ -34,7 +34,7 @@ class DB2Keywords extends KeywordList
{
{
return
'DB2'
;
return
'DB2'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
@@ -435,5 +435,4 @@ class DB2Keywords extends KeywordList
...
@@ -435,5 +435,4 @@ class DB2Keywords extends KeywordList
);
);
}
}
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php
View file @
b066e54f
...
@@ -31,32 +31,32 @@ namespace Doctrine\DBAL\Platforms\Keywords;
...
@@ -31,32 +31,32 @@ namespace Doctrine\DBAL\Platforms\Keywords;
abstract
class
KeywordList
abstract
class
KeywordList
{
{
private
$keywords
=
null
;
private
$keywords
=
null
;
/**
/**
* Check if the given word is a keyword of this dialect/vendor platform.
* Check if the given word is a keyword of this dialect/vendor platform.
*
*
* @param string $word
* @param string $word
* @return bool
* @return bool
*/
*/
public
function
isKeyword
(
$word
)
public
function
isKeyword
(
$word
)
{
{
if
(
$this
->
keywords
===
null
)
{
if
(
$this
->
keywords
===
null
)
{
$this
->
initializeKeywords
();
$this
->
initializeKeywords
();
}
}
return
isset
(
$this
->
keywords
[
strtoupper
(
$word
)]);
return
isset
(
$this
->
keywords
[
strtoupper
(
$word
)]);
}
}
protected
function
initializeKeywords
()
protected
function
initializeKeywords
()
{
{
$this
->
keywords
=
array_flip
(
array_map
(
'strtoupper'
,
$this
->
getKeywords
()));
$this
->
keywords
=
array_flip
(
array_map
(
'strtoupper'
,
$this
->
getKeywords
()));
}
}
abstract
protected
function
getKeywords
();
abstract
protected
function
getKeywords
();
/**
/**
* Name of this keyword list.
* Name of this keyword list.
*
*
* @return string
* @return string
*/
*/
abstract
public
function
getName
();
abstract
public
function
getName
();
...
...
lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class MsSQLKeywords extends KeywordList
...
@@ -35,7 +35,7 @@ class MsSQLKeywords extends KeywordList
{
{
return
'MsSQL'
;
return
'MsSQL'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
...
lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class MySQLKeywords extends KeywordList
...
@@ -35,7 +35,7 @@ class MySQLKeywords extends KeywordList
{
{
return
'MySQL'
;
return
'MySQL'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
...
lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class OracleKeywords extends KeywordList
...
@@ -35,7 +35,7 @@ class OracleKeywords extends KeywordList
{
{
return
'Oracle'
;
return
'Oracle'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
...
lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQLKeywords.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class PostgreSQLKeywords extends KeywordList
...
@@ -35,7 +35,7 @@ class PostgreSQLKeywords extends KeywordList
{
{
return
'PostgreSQL'
;
return
'PostgreSQL'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
...
lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
View file @
b066e54f
...
@@ -34,22 +34,22 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -34,22 +34,22 @@ class ReservedKeywordsValidator implements Visitor
* @var KeywordList[]
* @var KeywordList[]
*/
*/
private
$keywordLists
=
array
();
private
$keywordLists
=
array
();
/**
/**
* @var array
* @var array
*/
*/
private
$violations
=
array
();
private
$violations
=
array
();
public
function
__construct
(
array
$keywordLists
)
public
function
__construct
(
array
$keywordLists
)
{
{
$this
->
keywordLists
=
$keywordLists
;
$this
->
keywordLists
=
$keywordLists
;
}
}
public
function
getViolations
()
public
function
getViolations
()
{
{
return
$this
->
violations
;
return
$this
->
violations
;
}
}
/**
/**
* @param string $word
* @param string $word
* @return array
* @return array
...
@@ -59,7 +59,7 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -59,7 +59,7 @@ class ReservedKeywordsValidator implements Visitor
if
(
$word
[
0
]
==
"`"
)
{
if
(
$word
[
0
]
==
"`"
)
{
$word
=
str_replace
(
'`'
,
''
,
$word
);
$word
=
str_replace
(
'`'
,
''
,
$word
);
}
}
$keywordLists
=
array
();
$keywordLists
=
array
();
foreach
(
$this
->
keywordLists
AS
$keywordList
)
{
foreach
(
$this
->
keywordLists
AS
$keywordList
)
{
if
(
$keywordList
->
isKeyword
(
$word
))
{
if
(
$keywordList
->
isKeyword
(
$word
))
{
...
@@ -68,16 +68,16 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -68,16 +68,16 @@ class ReservedKeywordsValidator implements Visitor
}
}
return
$keywordLists
;
return
$keywordLists
;
}
}
private
function
addViolation
(
$asset
,
$violatedPlatforms
)
private
function
addViolation
(
$asset
,
$violatedPlatforms
)
{
{
if
(
!
$violatedPlatforms
)
{
if
(
!
$violatedPlatforms
)
{
return
;
return
;
}
}
$this
->
violations
[]
=
$asset
.
' keyword violations: '
.
implode
(
', '
,
$violatedPlatforms
);
$this
->
violations
[]
=
$asset
.
' keyword violations: '
.
implode
(
', '
,
$violatedPlatforms
);
}
}
public
function
acceptColumn
(
Table
$table
,
Column
$column
)
public
function
acceptColumn
(
Table
$table
,
Column
$column
)
{
{
$this
->
addViolation
(
$this
->
addViolation
(
...
@@ -88,7 +88,7 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -88,7 +88,7 @@ class ReservedKeywordsValidator implements Visitor
public
function
acceptForeignKey
(
Table
$localTable
,
ForeignKeyConstraint
$fkConstraint
)
public
function
acceptForeignKey
(
Table
$localTable
,
ForeignKeyConstraint
$fkConstraint
)
{
{
}
}
public
function
acceptIndex
(
Table
$table
,
Index
$index
)
public
function
acceptIndex
(
Table
$table
,
Index
$index
)
...
@@ -98,12 +98,12 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -98,12 +98,12 @@ class ReservedKeywordsValidator implements Visitor
public
function
acceptSchema
(
Schema
$schema
)
public
function
acceptSchema
(
Schema
$schema
)
{
{
}
}
public
function
acceptSequence
(
Sequence
$sequence
)
public
function
acceptSequence
(
Sequence
$sequence
)
{
{
}
}
public
function
acceptTable
(
Table
$table
)
public
function
acceptTable
(
Table
$table
)
...
...
lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
View file @
b066e54f
...
@@ -34,7 +34,7 @@ class SQLiteKeywords extends KeywordList
...
@@ -34,7 +34,7 @@ class SQLiteKeywords extends KeywordList
{
{
return
'SQLite'
;
return
'SQLite'
;
}
}
protected
function
getKeywords
()
protected
function
getKeywords
()
{
{
return
array
(
return
array
(
...
...
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
View file @
b066e54f
...
@@ -320,11 +320,11 @@ class MsSqlPlatform extends AbstractPlatform
...
@@ -320,11 +320,11 @@ class MsSqlPlatform extends AbstractPlatform
$queryParts
[]
=
'ALTER COLUMN '
.
$queryParts
[]
=
'ALTER COLUMN '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$column
->
toArray
());
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$column
->
toArray
());
}
}
$tableSql
=
array
();
$tableSql
=
array
();
if
(
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
return
array_merge
(
$tableSql
,
$columnSql
);
return
array_merge
(
$tableSql
,
$columnSql
);
}
}
foreach
(
$queryParts
as
$query
)
{
foreach
(
$queryParts
as
$query
)
{
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
b066e54f
...
@@ -504,7 +504,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -504,7 +504,7 @@ class MySqlPlatform extends AbstractPlatform
$sql
=
array
();
$sql
=
array
();
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
...
...
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
b066e54f
...
@@ -161,8 +161,8 @@ class OraclePlatform extends AbstractPlatform
...
@@ -161,8 +161,8 @@ class OraclePlatform extends AbstractPlatform
*/
*/
public
function
getBitOrComparisonExpression
(
$value1
,
$value2
)
public
function
getBitOrComparisonExpression
(
$value1
,
$value2
)
{
{
return
'('
.
$value1
.
'-'
.
return
'('
.
$value1
.
'-'
.
$this
->
getBitAndComparisonExpression
(
$value1
,
$value2
)
$this
->
getBitAndComparisonExpression
(
$value1
,
$value2
)
.
'+'
.
$value2
.
')'
;
.
'+'
.
$value2
.
')'
;
}
}
...
...
lib/Doctrine/DBAL/Portability/Connection.php
View file @
b066e54f
...
@@ -32,26 +32,26 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -32,26 +32,26 @@ class Connection extends \Doctrine\DBAL\Connection
const
PORTABILITY_RTRIM
=
1
;
const
PORTABILITY_RTRIM
=
1
;
const
PORTABILITY_EMPTY_TO_NULL
=
4
;
const
PORTABILITY_EMPTY_TO_NULL
=
4
;
const
PORTABILITY_FIX_CASE
=
8
;
const
PORTABILITY_FIX_CASE
=
8
;
const
PORTABILITY_ORACLE
=
9
;
const
PORTABILITY_ORACLE
=
9
;
const
PORTABILITY_POSTGRESQL
=
13
;
const
PORTABILITY_POSTGRESQL
=
13
;
const
PORTABILITY_SQLITE
=
13
;
const
PORTABILITY_SQLITE
=
13
;
const
PORTABILITY_OTHERVENDORS
=
12
;
const
PORTABILITY_OTHERVENDORS
=
12
;
/**
/**
* @var int
* @var int
*/
*/
private
$portability
=
self
::
PORTABILITY_NONE
;
private
$portability
=
self
::
PORTABILITY_NONE
;
/**
/**
* @var int
* @var int
*/
*/
private
$case
;
private
$case
;
public
function
connect
()
public
function
connect
()
{
{
$ret
=
parent
::
connect
();
$ret
=
parent
::
connect
();
if
(
$ret
)
{
if
(
$ret
)
{
$params
=
$this
->
getParams
();
$params
=
$this
->
getParams
();
if
(
isset
(
$params
[
'portability'
]))
{
if
(
isset
(
$params
[
'portability'
]))
{
if
(
$this
->
_platform
->
getName
()
===
"oracle"
)
{
if
(
$this
->
_platform
->
getName
()
===
"oracle"
)
{
...
@@ -72,26 +72,26 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -72,26 +72,26 @@ class Connection extends \Doctrine\DBAL\Connection
}
else
{
}
else
{
$this
->
case
=
(
$params
[
'fetch_case'
]
==
\PDO
::
CASE_LOWER
)
?
CASE_LOWER
:
CASE_UPPER
;
$this
->
case
=
(
$params
[
'fetch_case'
]
==
\PDO
::
CASE_LOWER
)
?
CASE_LOWER
:
CASE_UPPER
;
}
}
}
}
}
}
return
$ret
;
return
$ret
;
}
}
public
function
getPortability
()
public
function
getPortability
()
{
{
return
$this
->
portability
;
return
$this
->
portability
;
}
}
public
function
getFetchCase
()
public
function
getFetchCase
()
{
{
return
$this
->
case
;
return
$this
->
case
;
}
}
public
function
executeQuery
(
$query
,
array
$params
=
array
(),
$types
=
array
(),
QueryCacheProfile
$qcp
=
null
)
public
function
executeQuery
(
$query
,
array
$params
=
array
(),
$types
=
array
(),
QueryCacheProfile
$qcp
=
null
)
{
{
return
new
Statement
(
parent
::
executeQuery
(
$query
,
$params
,
$types
,
$qcp
),
$this
);
return
new
Statement
(
parent
::
executeQuery
(
$query
,
$params
,
$types
,
$qcp
),
$this
);
}
}
/**
/**
* Prepares an SQL statement.
* Prepares an SQL statement.
*
*
...
@@ -102,7 +102,7 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -102,7 +102,7 @@ class Connection extends \Doctrine\DBAL\Connection
{
{
return
new
Statement
(
parent
::
prepare
(
$statement
),
$this
);
return
new
Statement
(
parent
::
prepare
(
$statement
),
$this
);
}
}
public
function
query
()
public
function
query
()
{
{
$this
->
connect
();
$this
->
connect
();
...
...
lib/Doctrine/DBAL/Portability/Statement.php
View file @
b066e54f
...
@@ -48,7 +48,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
...
@@ -48,7 +48,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
*/
*/
private
$case
;
private
$case
;
/**
/**
* @var int
* @var int
*/
*/
private
$defaultFetchStyle
=
PDO
::
FETCH_BOTH
;
private
$defaultFetchStyle
=
PDO
::
FETCH_BOTH
;
...
...
lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php
View file @
b066e54f
...
@@ -34,40 +34,40 @@ class CompositeExpression implements \Countable
...
@@ -34,40 +34,40 @@ class CompositeExpression implements \Countable
* Constant that represents an AND composite expression
* Constant that represents an AND composite expression
*/
*/
const
TYPE_AND
=
'AND'
;
const
TYPE_AND
=
'AND'
;
/**
/**
* Constant that represents an OR composite expression
* Constant that represents an OR composite expression
*/
*/
const
TYPE_OR
=
'OR'
;
const
TYPE_OR
=
'OR'
;
/**
/**
* @var string Holds the instance type of composite expression
* @var string Holds the instance type of composite expression
*/
*/
private
$type
;
private
$type
;
/**
/**
* @var array Each expression part of the composite expression
* @var array Each expression part of the composite expression
*/
*/
private
$parts
=
array
();
private
$parts
=
array
();
/**
/**
* Constructor.
* Constructor.
*
*
* @param string $type Instance type of composite expression
* @param string $type Instance type of composite expression
* @param array $parts Composition of expressions to be joined on composite expression
* @param array $parts Composition of expressions to be joined on composite expression
*/
*/
public
function
__construct
(
$type
,
array
$parts
=
array
())
public
function
__construct
(
$type
,
array
$parts
=
array
())
{
{
$this
->
type
=
$type
;
$this
->
type
=
$type
;
$this
->
addMultiple
(
$parts
);
$this
->
addMultiple
(
$parts
);
}
}
/**
/**
* Adds multiple parts to composite expression.
* Adds multiple parts to composite expression.
*
*
* @param array $args
* @param array $args
*
*
* @return CompositeExpression
* @return CompositeExpression
*/
*/
public
function
addMultiple
(
array
$parts
=
array
())
public
function
addMultiple
(
array
$parts
=
array
())
...
@@ -75,38 +75,38 @@ class CompositeExpression implements \Countable
...
@@ -75,38 +75,38 @@ class CompositeExpression implements \Countable
foreach
((
array
)
$parts
as
$part
)
{
foreach
((
array
)
$parts
as
$part
)
{
$this
->
add
(
$part
);
$this
->
add
(
$part
);
}
}
return
$this
;
return
$this
;
}
}
/**
/**
* Adds an expression to composite expression.
* Adds an expression to composite expression.
*
*
* @param mixed $part
* @param mixed $part
* @return CompositeExpression
* @return CompositeExpression
*/
*/
public
function
add
(
$part
)
public
function
add
(
$part
)
{
{
if
(
!
empty
(
$part
)
||
(
$part
instanceof
self
&&
$part
->
count
()
>
0
))
{
if
(
!
empty
(
$part
)
||
(
$part
instanceof
self
&&
$part
->
count
()
>
0
))
{
$this
->
parts
[]
=
$part
;
$this
->
parts
[]
=
$part
;
}
}
return
$this
;
return
$this
;
}
}
/**
/**
* Retrieves the amount of expressions on composite expression.
* Retrieves the amount of expressions on composite expression.
*
*
* @return integer
* @return integer
*/
*/
public
function
count
()
public
function
count
()
{
{
return
count
(
$this
->
parts
);
return
count
(
$this
->
parts
);
}
}
/**
/**
* Retrieve the string representation of this composite expression.
* Retrieve the string representation of this composite expression.
*
*
* @return string
* @return string
*/
*/
public
function
__toString
()
public
function
__toString
()
...
@@ -114,13 +114,13 @@ class CompositeExpression implements \Countable
...
@@ -114,13 +114,13 @@ class CompositeExpression implements \Countable
if
(
count
(
$this
->
parts
)
===
1
)
{
if
(
count
(
$this
->
parts
)
===
1
)
{
return
(
string
)
$this
->
parts
[
0
];
return
(
string
)
$this
->
parts
[
0
];
}
}
return
'('
.
implode
(
') '
.
$this
->
type
.
' ('
,
$this
->
parts
)
.
')'
;
return
'('
.
implode
(
') '
.
$this
->
type
.
' ('
,
$this
->
parts
)
.
')'
;
}
}
/**
/**
* Return type of this composite expression (AND/OR)
* Return type of this composite expression (AND/OR)
*
*
* @return string
* @return string
*/
*/
public
function
getType
()
public
function
getType
()
...
...
lib/Doctrine/DBAL/Query/Expression/ExpressionBuilder.php
View file @
b066e54f
...
@@ -38,7 +38,7 @@ class ExpressionBuilder
...
@@ -38,7 +38,7 @@ class ExpressionBuilder
const
LTE
=
'<='
;
const
LTE
=
'<='
;
const
GT
=
'>'
;
const
GT
=
'>'
;
const
GTE
=
'>='
;
const
GTE
=
'>='
;
/**
/**
* @var Doctrine\DBAL\Connection DBAL Connection
* @var Doctrine\DBAL\Connection DBAL Connection
*/
*/
...
@@ -53,7 +53,7 @@ class ExpressionBuilder
...
@@ -53,7 +53,7 @@ class ExpressionBuilder
{
{
$this
->
connection
=
$connection
;
$this
->
connection
=
$connection
;
}
}
/**
/**
* Creates a conjunction of the given boolean expressions.
* Creates a conjunction of the given boolean expressions.
*
*
...
@@ -92,7 +92,7 @@ class ExpressionBuilder
...
@@ -92,7 +92,7 @@ class ExpressionBuilder
/**
/**
* Creates a comparison expression.
* Creates a comparison expression.
*
*
* @param mixed $x Left expression
* @param mixed $x Left expression
* @param string $operator One of the ExpressionBuikder::* constants.
* @param string $operator One of the ExpressionBuikder::* constants.
* @param mixed $y Right expression
* @param mixed $y Right expression
...
@@ -102,7 +102,7 @@ class ExpressionBuilder
...
@@ -102,7 +102,7 @@ class ExpressionBuilder
{
{
return
$x
.
' '
.
$operator
.
' '
.
$y
;
return
$x
.
' '
.
$operator
.
' '
.
$y
;
}
}
/**
/**
* Creates an equality comparison expression with the given arguments.
* Creates an equality comparison expression with the given arguments.
*
*
...
@@ -216,7 +216,7 @@ class ExpressionBuilder
...
@@ -216,7 +216,7 @@ class ExpressionBuilder
* Creates an IS NULL expression with the given arguments.
* Creates an IS NULL expression with the given arguments.
*
*
* @param string $x Field in string format to be restricted by IS NULL
* @param string $x Field in string format to be restricted by IS NULL
*
*
* @return string
* @return string
*/
*/
public
function
isNull
(
$x
)
public
function
isNull
(
$x
)
...
@@ -228,7 +228,7 @@ class ExpressionBuilder
...
@@ -228,7 +228,7 @@ class ExpressionBuilder
* Creates an IS NOT NULL expression with the given arguments.
* Creates an IS NOT NULL expression with the given arguments.
*
*
* @param string $x Field in string format to be restricted by IS NOT NULL
* @param string $x Field in string format to be restricted by IS NOT NULL
*
*
* @return string
* @return string
*/
*/
public
function
isNotNull
(
$x
)
public
function
isNotNull
(
$x
)
...
@@ -241,20 +241,20 @@ class ExpressionBuilder
...
@@ -241,20 +241,20 @@ class ExpressionBuilder
*
*
* @param string $x Field in string format to be inspected by LIKE() comparison.
* @param string $x Field in string format to be inspected by LIKE() comparison.
* @param mixed $y Argument to be used in LIKE() comparison.
* @param mixed $y Argument to be used in LIKE() comparison.
*
*
* @return string
* @return string
*/
*/
public
function
like
(
$x
,
$y
)
public
function
like
(
$x
,
$y
)
{
{
return
$this
->
comparison
(
$x
,
'LIKE'
,
$y
);
return
$this
->
comparison
(
$x
,
'LIKE'
,
$y
);
}
}
/**
/**
* Quotes a given input parameter.
* Quotes a given input parameter.
*
*
* @param mixed $input Parameter to be quoted.
* @param mixed $input Parameter to be quoted.
* @param string $type Type of the parameter.
* @param string $type Type of the parameter.
*
*
* @return string
* @return string
*/
*/
public
function
literal
(
$input
,
$type
=
null
)
public
function
literal
(
$input
,
$type
=
null
)
...
...
lib/Doctrine/DBAL/SQLParserUtils.php
View file @
b066e54f
...
@@ -34,21 +34,21 @@ class SQLParserUtils
...
@@ -34,21 +34,21 @@ class SQLParserUtils
{
{
/**
/**
* Get an array of the placeholders in an sql statements as keys and their positions in the query string.
* Get an array of the placeholders in an sql statements as keys and their positions in the query string.
*
*
* Returns an integer => integer pair (indexed from zero) for a positional statement
* Returns an integer => integer pair (indexed from zero) for a positional statement
* and a string => int[] pair for a named statement.
* and a string => int[] pair for a named statement.
*
*
* @param string $statement
* @param string $statement
* @param bool $isPositional
* @param bool $isPositional
* @return array
* @return array
*/
*/
static
public
function
getPlaceholderPositions
(
$statement
,
$isPositional
=
true
)
static
public
function
getPlaceholderPositions
(
$statement
,
$isPositional
=
true
)
{
{
$match
=
(
$isPositional
)
?
'?'
:
':'
;
$match
=
(
$isPositional
)
?
'?'
:
':'
;
if
(
strpos
(
$statement
,
$match
)
===
false
)
{
if
(
strpos
(
$statement
,
$match
)
===
false
)
{
return
array
();
return
array
();
}
}
$count
=
0
;
$count
=
0
;
$inLiteral
=
false
;
// a valid query never starts with quotes
$inLiteral
=
false
;
// a valid query never starts with quotes
$stmtLen
=
strlen
(
$statement
);
$stmtLen
=
strlen
(
$statement
);
...
@@ -75,16 +75,16 @@ class SQLParserUtils
...
@@ -75,16 +75,16 @@ class SQLParserUtils
return
$paramMap
;
return
$paramMap
;
}
}
/**
/**
* For a positional query this method can rewrite the sql statement with regard to array parameters.
* For a positional query this method can rewrite the sql statement with regard to array parameters.
*
*
* @param string $query
* @param string $query
* @param array $params
* @param array $params
* @param array $types
* @param array $types
*/
*/
static
public
function
expandListParameters
(
$query
,
$params
,
$types
)
static
public
function
expandListParameters
(
$query
,
$params
,
$types
)
{
{
$isPositional
=
is_int
(
key
(
$params
));
$isPositional
=
is_int
(
key
(
$params
));
$arrayPositions
=
array
();
$arrayPositions
=
array
();
$bindIndex
=
-
1
;
$bindIndex
=
-
1
;
...
@@ -94,15 +94,15 @@ class SQLParserUtils
...
@@ -94,15 +94,15 @@ class SQLParserUtils
if
(
$isPositional
)
{
if
(
$isPositional
)
{
$name
=
$bindIndex
;
$name
=
$bindIndex
;
}
}
$arrayPositions
[
$name
]
=
false
;
$arrayPositions
[
$name
]
=
false
;
}
}
}
}
if
((
!
$arrayPositions
&&
$isPositional
)
||
(
count
(
$params
)
!=
count
(
$types
)))
{
if
((
!
$arrayPositions
&&
$isPositional
)
||
(
count
(
$params
)
!=
count
(
$types
)))
{
return
array
(
$query
,
$params
,
$types
);
return
array
(
$query
,
$params
,
$types
);
}
}
$paramPos
=
self
::
getPlaceholderPositions
(
$query
,
$isPositional
);
$paramPos
=
self
::
getPlaceholderPositions
(
$query
,
$isPositional
);
if
(
$isPositional
)
{
if
(
$isPositional
)
{
$paramOffset
=
0
;
$paramOffset
=
0
;
...
@@ -111,30 +111,30 @@ class SQLParserUtils
...
@@ -111,30 +111,30 @@ class SQLParserUtils
if
(
!
isset
(
$arrayPositions
[
$needle
]))
{
if
(
!
isset
(
$arrayPositions
[
$needle
]))
{
continue
;
continue
;
}
}
$needle
+=
$paramOffset
;
$needle
+=
$paramOffset
;
$needlePos
+=
$queryOffset
;
$needlePos
+=
$queryOffset
;
$len
=
count
(
$params
[
$needle
]);
$len
=
count
(
$params
[
$needle
]);
$params
=
array_merge
(
$params
=
array_merge
(
array_slice
(
$params
,
0
,
$needle
),
array_slice
(
$params
,
0
,
$needle
),
$params
[
$needle
],
$params
[
$needle
],
array_slice
(
$params
,
$needle
+
1
)
array_slice
(
$params
,
$needle
+
1
)
);
);
$types
=
array_merge
(
$types
=
array_merge
(
array_slice
(
$types
,
0
,
$needle
),
array_slice
(
$types
,
0
,
$needle
),
array_fill
(
0
,
$len
,
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
),
// array needles are at PDO::PARAM_* + 100
array_fill
(
0
,
$len
,
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
),
// array needles are at PDO::PARAM_* + 100
array_slice
(
$types
,
$needle
+
1
)
array_slice
(
$types
,
$needle
+
1
)
);
);
$expandStr
=
implode
(
", "
,
array_fill
(
0
,
$len
,
"?"
));
$expandStr
=
implode
(
", "
,
array_fill
(
0
,
$len
,
"?"
));
$query
=
substr
(
$query
,
0
,
$needlePos
)
.
$expandStr
.
substr
(
$query
,
$needlePos
+
1
);
$query
=
substr
(
$query
,
0
,
$needlePos
)
.
$expandStr
.
substr
(
$query
,
$needlePos
+
1
);
$paramOffset
+=
(
$len
-
1
);
// Grows larger by number of parameters minus the replaced needle.
$paramOffset
+=
(
$len
-
1
);
// Grows larger by number of parameters minus the replaced needle.
$queryOffset
+=
(
strlen
(
$expandStr
)
-
1
);
$queryOffset
+=
(
strlen
(
$expandStr
)
-
1
);
}
}
}
else
{
}
else
{
$queryOffset
=
0
;
$queryOffset
=
0
;
$typesOrd
=
array
();
$typesOrd
=
array
();
...
@@ -144,7 +144,7 @@ class SQLParserUtils
...
@@ -144,7 +144,7 @@ class SQLParserUtils
$token
=
substr
(
$needle
,
0
,
1
);
$token
=
substr
(
$needle
,
0
,
1
);
$needle
=
substr
(
$needle
,
1
);
$needle
=
substr
(
$needle
,
1
);
$value
=
$params
[
$needle
];
$value
=
$params
[
$needle
];
if
(
!
isset
(
$arrayPositions
[
$needle
]))
{
if
(
!
isset
(
$arrayPositions
[
$needle
]))
{
foreach
(
$needlePos
as
$pos
)
{
foreach
(
$needlePos
as
$pos
)
{
$pos
+=
$queryOffset
;
$pos
+=
$queryOffset
;
...
@@ -157,23 +157,23 @@ class SQLParserUtils
...
@@ -157,23 +157,23 @@ class SQLParserUtils
$len
=
count
(
$value
);
$len
=
count
(
$value
);
$expandStr
=
implode
(
", "
,
array_fill
(
0
,
$len
,
"?"
));
$expandStr
=
implode
(
", "
,
array_fill
(
0
,
$len
,
"?"
));
foreach
(
$needlePos
as
$pos
)
{
foreach
(
$needlePos
as
$pos
)
{
foreach
(
$value
as
$val
)
{
foreach
(
$value
as
$val
)
{
$paramsOrd
[]
=
$val
;
$paramsOrd
[]
=
$val
;
$typesOrd
[]
=
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
;
$typesOrd
[]
=
$types
[
$needle
]
-
Connection
::
ARRAY_PARAM_OFFSET
;
}
}
$pos
+=
$queryOffset
;
$pos
+=
$queryOffset
;
$queryOffset
+=
(
strlen
(
$expandStr
)
-
$paramLen
);
$queryOffset
+=
(
strlen
(
$expandStr
)
-
$paramLen
);
$query
=
substr
(
$query
,
0
,
$pos
)
.
$expandStr
.
substr
(
$query
,
(
$pos
+
$paramLen
));
$query
=
substr
(
$query
,
0
,
$pos
)
.
$expandStr
.
substr
(
$query
,
(
$pos
+
$paramLen
));
}
}
}
}
}
}
$types
=
$typesOrd
;
$types
=
$typesOrd
;
$params
=
$paramsOrd
;
$params
=
$paramsOrd
;
}
}
return
array
(
$query
,
$params
,
$types
);
return
array
(
$query
,
$params
,
$types
);
}
}
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
View file @
b066e54f
...
@@ -76,7 +76,7 @@ abstract class AbstractSchemaManager
...
@@ -76,7 +76,7 @@ abstract class AbstractSchemaManager
}
}
/**
/**
* Try any method on the schema manager. Normally a method throws an
* Try any method on the schema manager. Normally a method throws an
* exception when your DBMS doesn't support it or if an error occurs.
* exception when your DBMS doesn't support it or if an error occurs.
* This method allows you to try and method on your SchemaManager
* This method allows you to try and method on your SchemaManager
* instance and will return false if it does not work or is not supported.
* instance and will return false if it does not work or is not supported.
...
@@ -178,7 +178,7 @@ abstract class AbstractSchemaManager
...
@@ -178,7 +178,7 @@ abstract class AbstractSchemaManager
/**
/**
* Return true if all the given tables exist.
* Return true if all the given tables exist.
*
*
* @param array $tableNames
* @param array $tableNames
* @return bool
* @return bool
*/
*/
...
@@ -271,7 +271,7 @@ abstract class AbstractSchemaManager
...
@@ -271,7 +271,7 @@ abstract class AbstractSchemaManager
/**
/**
* Drops a database.
* Drops a database.
*
*
* NOTE: You can not drop the database this SchemaManager is currently connected to.
* NOTE: You can not drop the database this SchemaManager is currently connected to.
*
*
* @param string $database The name of the database to drop
* @param string $database The name of the database to drop
...
@@ -793,7 +793,7 @@ abstract class AbstractSchemaManager
...
@@ -793,7 +793,7 @@ abstract class AbstractSchemaManager
/**
/**
* Create a schema instance for the current database.
* Create a schema instance for the current database.
*
*
* @return Schema
* @return Schema
*/
*/
public
function
createSchema
()
public
function
createSchema
()
...
@@ -823,7 +823,7 @@ abstract class AbstractSchemaManager
...
@@ -823,7 +823,7 @@ abstract class AbstractSchemaManager
/**
/**
* Given a table comment this method tries to extract a typehint for Doctrine Type, or returns
* Given a table comment this method tries to extract a typehint for Doctrine Type, or returns
* the type given as default.
* the type given as default.
*
*
* @param string $comment
* @param string $comment
* @param string $currentType
* @param string $currentType
* @return string
* @return string
...
...
lib/Doctrine/DBAL/Schema/Column.php
View file @
b066e54f
...
@@ -100,7 +100,7 @@ class Column extends AbstractAsset
...
@@ -100,7 +100,7 @@ class Column extends AbstractAsset
/**
/**
* Create a new Column
* Create a new Column
*
*
* @param string $columnName
* @param string $columnName
* @param Doctrine\DBAL\Types\Type $type
* @param Doctrine\DBAL\Types\Type $type
* @param int $length
* @param int $length
...
...
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
b066e54f
...
@@ -163,7 +163,7 @@ class Comparator
...
@@ -163,7 +163,7 @@ class Comparator
$changes
++
;
$changes
++
;
}
}
}
}
foreach
(
$table1Columns
as
$columnName
=>
$column
)
{
foreach
(
$table1Columns
as
$columnName
=>
$column
)
{
if
(
$table2
->
hasColumn
(
$columnName
)
)
{
if
(
$table2
->
hasColumn
(
$columnName
)
)
{
$changedProperties
=
$this
->
diffColumn
(
$column
,
$table2
->
getColumn
(
$columnName
)
);
$changedProperties
=
$this
->
diffColumn
(
$column
,
$table2
->
getColumn
(
$columnName
)
);
...
@@ -241,7 +241,7 @@ class Comparator
...
@@ -241,7 +241,7 @@ class Comparator
/**
/**
* Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
* Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
* however ambiguouties between different possibilites should not lead to renaming at all.
* however ambiguouties between different possibilites should not lead to renaming at all.
*
*
* @param TableDiff $tableDifferences
* @param TableDiff $tableDifferences
*/
*/
private
function
detectColumnRenamings
(
TableDiff
$tableDifferences
)
private
function
detectColumnRenamings
(
TableDiff
$tableDifferences
)
...
@@ -278,7 +278,7 @@ class Comparator
...
@@ -278,7 +278,7 @@ class Comparator
if
(
array_map
(
'strtolower'
,
$key1
->
getLocalColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getLocalColumns
()))
{
if
(
array_map
(
'strtolower'
,
$key1
->
getLocalColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getLocalColumns
()))
{
return
true
;
return
true
;
}
}
if
(
array_map
(
'strtolower'
,
$key1
->
getForeignColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getForeignColumns
()))
{
if
(
array_map
(
'strtolower'
,
$key1
->
getForeignColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getForeignColumns
()))
{
return
true
;
return
true
;
}
}
...
...
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
View file @
b066e54f
...
@@ -48,7 +48,7 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -48,7 +48,7 @@ class DB2SchemaManager extends AbstractSchemaManager
$sql
.=
" AND CREATOR = UPPER('"
.
$this
->
_conn
->
getUsername
()
.
"')"
;
$sql
.=
" AND CREATOR = UPPER('"
.
$this
->
_conn
->
getUsername
()
.
"')"
;
$tables
=
$this
->
_conn
->
fetchAll
(
$sql
);
$tables
=
$this
->
_conn
->
fetchAll
(
$sql
);
return
$this
->
_getPortableTablesList
(
$tables
);
return
$this
->
_getPortableTablesList
(
$tables
);
}
}
...
@@ -70,7 +70,7 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -70,7 +70,7 @@ class DB2SchemaManager extends AbstractSchemaManager
$precision
=
false
;
$precision
=
false
;
$type
=
$this
->
_platform
->
getDoctrineTypeMapping
(
$tableColumn
[
'typename'
]);
$type
=
$this
->
_platform
->
getDoctrineTypeMapping
(
$tableColumn
[
'typename'
]);
switch
(
strtolower
(
$tableColumn
[
'typename'
]))
{
switch
(
strtolower
(
$tableColumn
[
'typename'
]))
{
case
'varchar'
:
case
'varchar'
:
$length
=
$tableColumn
[
'length'
];
$length
=
$tableColumn
[
'length'
];
...
...
lib/Doctrine/DBAL/Schema/Index.php
View file @
b066e54f
...
@@ -76,10 +76,10 @@ class Index extends AbstractAsset implements Constraint
...
@@ -76,10 +76,10 @@ class Index extends AbstractAsset implements Constraint
{
{
return
$this
->
_columns
;
return
$this
->
_columns
;
}
}
/**
/**
* Is the index neither unique nor primary key?
* Is the index neither unique nor primary key?
*
*
* @return bool
* @return bool
*/
*/
public
function
isSimpleIndex
()
public
function
isSimpleIndex
()
...
...
lib/Doctrine/DBAL/Schema/OracleSchemaManager.php
View file @
b066e54f
...
@@ -89,7 +89,7 @@ class OracleSchemaManager extends AbstractSchemaManager
...
@@ -89,7 +89,7 @@ class OracleSchemaManager extends AbstractSchemaManager
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{
{
$tableColumn
=
\array_change_key_case
(
$tableColumn
,
CASE_LOWER
);
$tableColumn
=
\array_change_key_case
(
$tableColumn
,
CASE_LOWER
);
$dbType
=
strtolower
(
$tableColumn
[
'data_type'
]);
$dbType
=
strtolower
(
$tableColumn
[
'data_type'
]);
if
(
strpos
(
$dbType
,
"timestamp("
)
===
0
)
{
if
(
strpos
(
$dbType
,
"timestamp("
)
===
0
)
{
if
(
strpos
(
$dbType
,
"WITH TIME ZONE"
))
{
if
(
strpos
(
$dbType
,
"WITH TIME ZONE"
))
{
...
...
lib/Doctrine/DBAL/Schema/Schema.php
View file @
b066e54f
...
@@ -40,7 +40,7 @@ class Schema extends AbstractAsset
...
@@ -40,7 +40,7 @@ class Schema extends AbstractAsset
* @var array
* @var array
*/
*/
protected
$_tables
=
array
();
protected
$_tables
=
array
();
/**
/**
* @var array
* @var array
*/
*/
...
@@ -109,7 +109,7 @@ class Schema extends AbstractAsset
...
@@ -109,7 +109,7 @@ class Schema extends AbstractAsset
/**
/**
* Get all tables of this schema.
* Get all tables of this schema.
*
*
* @return array
* @return array
*/
*/
public
function
getTables
()
public
function
getTables
()
...
@@ -133,7 +133,7 @@ class Schema extends AbstractAsset
...
@@ -133,7 +133,7 @@ class Schema extends AbstractAsset
/**
/**
* Does this schema have a table with the given name?
* Does this schema have a table with the given name?
*
*
* @param string $tableName
* @param string $tableName
* @return Schema
* @return Schema
*/
*/
...
@@ -177,7 +177,7 @@ class Schema extends AbstractAsset
...
@@ -177,7 +177,7 @@ class Schema extends AbstractAsset
/**
/**
* Create a new table
* Create a new table
*
*
* @param string $tableName
* @param string $tableName
* @return Table
* @return Table
*/
*/
...
@@ -221,7 +221,7 @@ class Schema extends AbstractAsset
...
@@ -221,7 +221,7 @@ class Schema extends AbstractAsset
/**
/**
* Create a new sequence
* Create a new sequence
*
*
* @param string $sequenceName
* @param string $sequenceName
* @param int $allocationSize
* @param int $allocationSize
* @param int $initialValue
* @param int $initialValue
...
@@ -301,7 +301,7 @@ class Schema extends AbstractAsset
...
@@ -301,7 +301,7 @@ class Schema extends AbstractAsset
public
function
visit
(
Visitor
$visitor
)
public
function
visit
(
Visitor
$visitor
)
{
{
$visitor
->
acceptSchema
(
$this
);
$visitor
->
acceptSchema
(
$this
);
foreach
(
$this
->
_tables
AS
$table
)
{
foreach
(
$this
->
_tables
AS
$table
)
{
$table
->
visit
(
$visitor
);
$table
->
visit
(
$visitor
);
}
}
...
...
lib/Doctrine/DBAL/Schema/Sequence.php
View file @
b066e54f
...
@@ -66,7 +66,7 @@ class Sequence extends AbstractAsset
...
@@ -66,7 +66,7 @@ class Sequence extends AbstractAsset
{
{
return
$this
->
_initialValue
;
return
$this
->
_initialValue
;
}
}
public
function
setAllocationSize
(
$allocationSize
)
public
function
setAllocationSize
(
$allocationSize
)
{
{
$this
->
_allocationSize
=
(
is_numeric
(
$allocationSize
))
?
$allocationSize
:
1
;
$this
->
_allocationSize
=
(
is_numeric
(
$allocationSize
))
?
$allocationSize
:
1
;
...
...
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
View file @
b066e54f
...
@@ -33,7 +33,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -33,7 +33,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
{
{
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*
*
* @override
* @override
*/
*/
public
function
dropDatabase
(
$database
)
public
function
dropDatabase
(
$database
)
...
@@ -45,7 +45,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
...
@@ -45,7 +45,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*
*
* @override
* @override
*/
*/
public
function
createDatabase
(
$database
)
public
function
createDatabase
(
$database
)
...
...
lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
View file @
b066e54f
...
@@ -83,7 +83,7 @@ class CreateSchemaSqlCollector implements Visitor
...
@@ -83,7 +83,7 @@ class CreateSchemaSqlCollector implements Visitor
public
function
acceptColumn
(
Table
$table
,
Column
$column
)
public
function
acceptColumn
(
Table
$table
,
Column
$column
)
{
{
}
}
/**
/**
...
@@ -108,7 +108,7 @@ class CreateSchemaSqlCollector implements Visitor
...
@@ -108,7 +108,7 @@ class CreateSchemaSqlCollector implements Visitor
*/
*/
public
function
acceptIndex
(
Table
$table
,
Index
$index
)
public
function
acceptIndex
(
Table
$table
,
Index
$index
)
{
{
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
View file @
b066e54f
...
@@ -37,18 +37,18 @@ class ReservedWordsCommand extends Command
...
@@ -37,18 +37,18 @@ class ReservedWordsCommand extends Command
'oracle'
=>
'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'
,
'oracle'
=>
'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'
,
'db2'
=>
'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'
,
'db2'
=>
'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'
,
);
);
/**
/**
* If you want to add or replace a keywords list use this command
* If you want to add or replace a keywords list use this command
*
*
* @param string $name
* @param string $name
* @param string $class
* @param string $class
*/
*/
public
function
setKeywordListClass
(
$name
,
$class
)
public
function
setKeywordListClass
(
$name
,
$class
)
{
{
$this
->
keywordListClasses
[
$name
]
=
$class
;
$this
->
keywordListClasses
[
$name
]
=
$class
;
}
}
/**
/**
* @see Console\Command\Command
* @see Console\Command\Command
*/
*/
...
@@ -70,12 +70,12 @@ By default SQLite, MySQL, PostgreSQL, MsSQL and Oracle
...
@@ -70,12 +70,12 @@ By default SQLite, MySQL, PostgreSQL, MsSQL and Oracle
keywords are checked:
keywords are checked:
<info>doctrine dbal:reserved-words</info>
<info>doctrine dbal:reserved-words</info>
If you want to check against specific dialects you can
If you want to check against specific dialects you can
pass them to the command:
pass them to the command:
<info>doctrine dbal:reserved-words mysql pgsql</info>
<info>doctrine dbal:reserved-words mysql pgsql</info>
The following keyword lists are currently shipped with Doctrine:
The following keyword lists are currently shipped with Doctrine:
* mysql
* mysql
...
@@ -87,7 +87,7 @@ The following keyword lists are currently shipped with Doctrine:
...
@@ -87,7 +87,7 @@ The following keyword lists are currently shipped with Doctrine:
EOT
EOT
);
);
}
}
/**
/**
* @see Console\Command\Command
* @see Console\Command\Command
*/
*/
...
@@ -95,12 +95,12 @@ EOT
...
@@ -95,12 +95,12 @@ EOT
{
{
/* @var $conn Doctrine\DBAL\Connection */
/* @var $conn Doctrine\DBAL\Connection */
$conn
=
$this
->
getHelper
(
'db'
)
->
getConnection
();
$conn
=
$this
->
getHelper
(
'db'
)
->
getConnection
();
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
if
(
!
$keywordLists
)
{
if
(
!
$keywordLists
)
{
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'mssql'
);
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'mssql'
);
}
}
$keywords
=
array
();
$keywords
=
array
();
foreach
(
$keywordLists
AS
$keywordList
)
{
foreach
(
$keywordLists
AS
$keywordList
)
{
if
(
!
isset
(
$this
->
keywordListClasses
[
$keywordList
]))
{
if
(
!
isset
(
$this
->
keywordListClasses
[
$keywordList
]))
{
...
@@ -112,14 +112,14 @@ EOT
...
@@ -112,14 +112,14 @@ EOT
$class
=
$this
->
keywordListClasses
[
$keywordList
];
$class
=
$this
->
keywordListClasses
[
$keywordList
];
$keywords
[]
=
new
$class
;
$keywords
[]
=
new
$class
;
}
}
$output
->
write
(
'Checking keyword violations for <comment>'
.
implode
(
", "
,
$keywordLists
)
.
"</comment>..."
,
true
);
$output
->
write
(
'Checking keyword violations for <comment>'
.
implode
(
", "
,
$keywordLists
)
.
"</comment>..."
,
true
);
/* @var $schema \Doctrine\DBAL\Schema\Schema */
/* @var $schema \Doctrine\DBAL\Schema\Schema */
$schema
=
$conn
->
getSchemaManager
()
->
createSchema
();
$schema
=
$conn
->
getSchemaManager
()
->
createSchema
();
$visitor
=
new
ReservedKeywordsValidator
(
$keywords
);
$visitor
=
new
ReservedKeywordsValidator
(
$keywords
);
$schema
->
visit
(
$visitor
);
$schema
->
visit
(
$visitor
);
$violations
=
$visitor
->
getViolations
();
$violations
=
$visitor
->
getViolations
();
if
(
count
(
$violations
)
==
0
)
{
if
(
count
(
$violations
)
==
0
)
{
$output
->
write
(
"No reserved keywords violations have been found!"
,
true
);
$output
->
write
(
"No reserved keywords violations have been found!"
,
true
);
...
...
lib/Doctrine/DBAL/Types/BooleanType.php
View file @
b066e54f
...
@@ -39,7 +39,7 @@ class BooleanType extends Type
...
@@ -39,7 +39,7 @@ class BooleanType extends Type
{
{
return
$platform
->
convertBooleans
(
$value
);
return
$platform
->
convertBooleans
(
$value
);
}
}
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
{
return
(
null
===
$value
)
?
null
:
(
bool
)
$value
;
return
(
null
===
$value
)
?
null
:
(
bool
)
$value
;
...
...
lib/Doctrine/DBAL/Types/ConversionException.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class ConversionException extends \Doctrine\DBAL\DBALException
...
@@ -35,7 +35,7 @@ class ConversionException extends \Doctrine\DBAL\DBALException
{
{
/**
/**
* Thrown when a Database to Doctrine Type Conversion fails.
* Thrown when a Database to Doctrine Type Conversion fails.
*
*
* @param string $value
* @param string $value
* @param string $toType
* @param string $toType
* @return ConversionException
* @return ConversionException
...
@@ -45,11 +45,11 @@ class ConversionException extends \Doctrine\DBAL\DBALException
...
@@ -45,11 +45,11 @@ class ConversionException extends \Doctrine\DBAL\DBALException
$value
=
(
strlen
(
$value
)
>
32
)
?
substr
(
$value
,
0
,
20
)
.
"..."
:
$value
;
$value
=
(
strlen
(
$value
)
>
32
)
?
substr
(
$value
,
0
,
20
)
.
"..."
:
$value
;
return
new
self
(
'Could not convert database value "'
.
$value
.
'" to Doctrine Type '
.
$toType
);
return
new
self
(
'Could not convert database value "'
.
$value
.
'" to Doctrine Type '
.
$toType
);
}
}
/**
/**
* Thrown when a Database to Doctrine Type Conversion fails and we can make a statement
* Thrown when a Database to Doctrine Type Conversion fails and we can make a statement
* about the expected format.
* about the expected format.
*
*
* @param string $value
* @param string $value
* @param string $toType
* @param string $toType
* @return ConversionException
* @return ConversionException
...
...
lib/Doctrine/DBAL/Types/DateTimeType.php
View file @
b066e54f
...
@@ -43,7 +43,7 @@ class DateTimeType extends Type
...
@@ -43,7 +43,7 @@ class DateTimeType extends Type
return
(
$value
!==
null
)
return
(
$value
!==
null
)
?
$value
->
format
(
$platform
->
getDateTimeFormatString
())
:
null
;
?
$value
->
format
(
$platform
->
getDateTimeFormatString
())
:
null
;
}
}
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
{
if
(
$value
===
null
)
{
if
(
$value
===
null
)
{
...
...
lib/Doctrine/DBAL/Types/DateTimeTzType.php
View file @
b066e54f
...
@@ -52,7 +52,7 @@ class DateTimeTzType extends Type
...
@@ -52,7 +52,7 @@ class DateTimeTzType extends Type
{
{
return
Type
::
DATETIMETZ
;
return
Type
::
DATETIMETZ
;
}
}
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
public
function
getSQLDeclaration
(
array
$fieldDeclaration
,
AbstractPlatform
$platform
)
{
{
return
$platform
->
getDateTimeTzTypeDeclarationSQL
(
$fieldDeclaration
);
return
$platform
->
getDateTimeTzTypeDeclarationSQL
(
$fieldDeclaration
);
...
...
lib/Doctrine/DBAL/Types/DateType.php
View file @
b066e54f
...
@@ -40,10 +40,10 @@ class DateType extends Type
...
@@ -40,10 +40,10 @@ class DateType extends Type
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
{
{
return
(
$value
!==
null
)
return
(
$value
!==
null
)
?
$value
->
format
(
$platform
->
getDateFormatString
())
:
null
;
?
$value
->
format
(
$platform
->
getDateFormatString
())
:
null
;
}
}
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
{
if
(
$value
===
null
)
{
if
(
$value
===
null
)
{
...
...
lib/Doctrine/DBAL/Types/TimeType.php
View file @
b066e54f
...
@@ -46,7 +46,7 @@ class TimeType extends Type
...
@@ -46,7 +46,7 @@ class TimeType extends Type
*/
*/
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
{
{
return
(
$value
!==
null
)
return
(
$value
!==
null
)
?
$value
->
format
(
$platform
->
getTimeFormatString
())
:
null
;
?
$value
->
format
(
$platform
->
getTimeFormatString
())
:
null
;
}
}
...
...
lib/Doctrine/DBAL/Version.php
View file @
b066e54f
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
* and is licensed under the LGPL. For more information, see
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
* <http://www.doctrine-project.org>.
*/
*/
namespace
Doctrine\DBAL
;
namespace
Doctrine\DBAL
;
/**
/**
...
@@ -42,7 +42,7 @@ class Version
...
@@ -42,7 +42,7 @@ class Version
* Compares a Doctrine version with the current one.
* Compares a Doctrine version with the current one.
*
*
* @param string $version Doctrine version to compare.
* @param string $version Doctrine version to compare.
* @return int Returns -1 if older, 0 if it is the same, 1 if version
* @return int Returns -1 if older, 0 if it is the same, 1 if version
* passed as argument is newer.
* passed as argument is newer.
*/
*/
public
static
function
compare
(
$version
)
public
static
function
compare
(
$version
)
...
...
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
b066e54f
...
@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection;
...
@@ -8,7 +8,7 @@ use Doctrine\DBAL\Connection;
use
Doctrine\Common\EventManager
;
use
Doctrine\Common\EventManager
;
use
Doctrine\DBAL\Configuration
;
use
Doctrine\DBAL\Configuration
;
use
Doctrine\DBAL\Events
;
use
Doctrine\DBAL\Events
;
class
ConnectionTest
extends
\Doctrine\Tests\DbalTestCase
class
ConnectionTest
extends
\Doctrine\Tests\DbalTestCase
{
{
/**
/**
...
...
tests/Doctrine/Tests/DBAL/Driver/OCI8/OCI8StatementTest.php
View file @
b066e54f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Doctrine\Tests\DBAL
;
namespace
Doctrine\Tests\DBAL
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
OCI8StatementTest
extends
\Doctrine\Tests\DbalTestCase
class
OCI8StatementTest
extends
\Doctrine\Tests\DbalTestCase
{
{
public
function
setUp
()
public
function
setUp
()
...
@@ -11,7 +11,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
...
@@ -11,7 +11,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
if
(
!
extension_loaded
(
'oci8'
))
{
if
(
!
extension_loaded
(
'oci8'
))
{
$this
->
markTestSkipped
(
'oci8 is not installed.'
);
$this
->
markTestSkipped
(
'oci8 is not installed.'
);
}
}
parent
::
setUp
();
parent
::
setUp
();
}
}
...
@@ -21,7 +21,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
...
@@ -21,7 +21,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
$statement
=
"update table set field1 = ?, field2 = ? where field3 = ?"
;
$statement
=
"update table set field1 = ?, field2 = ? where field3 = ?"
;
$executeMode
=
OCI_COMMIT_ON_SUCCESS
;
$executeMode
=
OCI_COMMIT_ON_SUCCESS
;
return
$this
->
getMock
(
'\Doctrine\DBAL\Driver\OCI8\OCI8Statement'
,
return
$this
->
getMock
(
'\Doctrine\DBAL\Driver\OCI8\OCI8Statement'
,
array
(
'bindValue'
,
'errorInfo'
),
array
(
'bindValue'
,
'errorInfo'
),
array
(
null
,
$statement
,
$executeMode
),
''
,
false
);
array
(
null
,
$statement
,
$executeMode
),
''
,
false
);
}
}
...
@@ -29,7 +29,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
...
@@ -29,7 +29,7 @@ class OCI8StatementTest extends \Doctrine\Tests\DbalTestCase
/**
/**
* This scenario shows that when the first parameter is not null
* This scenario shows that when the first parameter is not null
* it properly sets $hasZeroIndex to 1 and calls bindValue starting at 1.
* it properly sets $hasZeroIndex to 1 and calls bindValue starting at 1.
*
*
* The expected exception is due to oci_execute failing due to no valid connection.
* The expected exception is due to oci_execute failing due to no valid connection.
*
*
* @dataProvider executeDataProvider
* @dataProvider executeDataProvider
...
...
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
b066e54f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Doctrine\Tests\DBAL
;
namespace
Doctrine\Tests\DBAL
;
require_once
__DIR__
.
'/../TestInit.php'
;
require_once
__DIR__
.
'/../TestInit.php'
;
class
DriverManagerTest
extends
\Doctrine\Tests\DbalTestCase
class
DriverManagerTest
extends
\Doctrine\Tests\DbalTestCase
{
{
/**
/**
...
...
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
View file @
b066e54f
...
@@ -39,7 +39,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -39,7 +39,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
try
{
try
{
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
beginTransaction
();
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
try
{
try
{
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
beginTransaction
();
$this
->
assertEquals
(
2
,
$this
->
_conn
->
getTransactionNestingLevel
());
$this
->
assertEquals
(
2
,
$this
->
_conn
->
getTransactionNestingLevel
());
...
@@ -48,7 +48,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -48,7 +48,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$this
->
_conn
->
rollback
();
$this
->
_conn
->
rollback
();
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
//no rethrow
//no rethrow
}
}
$this
->
assertTrue
(
$this
->
_conn
->
isRollbackOnly
());
$this
->
assertTrue
(
$this
->
_conn
->
isRollbackOnly
());
...
@@ -164,9 +164,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -164,9 +164,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
try
{
try
{
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
beginTransaction
();
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
throw
new
\Exception
;
throw
new
\Exception
;
$this
->
_conn
->
commit
();
// never reached
$this
->
_conn
->
commit
();
// never reached
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
$this
->
assertEquals
(
1
,
$this
->
_conn
->
getTransactionNestingLevel
());
...
...
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
View file @
b066e54f
...
@@ -185,7 +185,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -185,7 +185,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt
->
closeCursor
();
$stmt
->
closeCursor
();
return
$data
;
return
$data
;
}
}
private
function
hydrateStmtIterator
(
$stmt
,
$fetchStyle
=
\PDO
::
FETCH_ASSOC
)
private
function
hydrateStmtIterator
(
$stmt
,
$fetchStyle
=
\PDO
::
FETCH_ASSOC
)
{
{
$data
=
array
();
$data
=
array
();
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/MsSqlSchemaManagerTest.php
View file @
b066e54f
...
@@ -5,8 +5,8 @@ namespace Doctrine\Tests\DBAL\Functional\Schema;
...
@@ -5,8 +5,8 @@ namespace Doctrine\Tests\DBAL\Functional\Schema;
use
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Schema
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
MsSqlSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
class
MsSqlSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
{
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Schema\Table;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Schema\Table;
use
Doctrine\DBAL\Schema\Schema
;
use
Doctrine\DBAL\Schema\Schema
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
MySqlSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
class
MySqlSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
{
public
function
testSwitchPrimaryKeyColumns
()
public
function
testSwitchPrimaryKeyColumns
()
...
@@ -41,7 +41,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -41,7 +41,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
_sm
->
createTable
(
$table
);
$this
->
_sm
->
createTable
(
$table
);
$tableFetched
=
$this
->
_sm
->
listTableDetails
(
"diffbug_routing_translations"
);
$tableFetched
=
$this
->
_sm
->
listTableDetails
(
"diffbug_routing_translations"
);
$comparator
=
new
\Doctrine\DBAL\Schema\Comparator
;
$comparator
=
new
\Doctrine\DBAL\Schema\Comparator
;
$diff
=
$comparator
->
diffTable
(
$tableFetched
,
$table
);
$diff
=
$comparator
->
diffTable
(
$tableFetched
,
$table
);
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
View file @
b066e54f
...
@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Schema;
...
@@ -5,7 +5,7 @@ namespace Doctrine\Tests\DBAL\Functional\Schema;
use
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Schema
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
OracleSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
class
OracleSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
{
public
function
setUp
()
public
function
setUp
()
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
View file @
b066e54f
...
@@ -35,7 +35,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -35,7 +35,7 @@ class SqliteSchemaManagerTest extends SchemaManagerFunctionalTestCase
{
{
$this
->
_sm
->
renameTable
(
'oldname'
,
'newname'
);
$this
->
_sm
->
renameTable
(
'oldname'
,
'newname'
);
}
}
public
function
testAutoincrementDetection
()
public
function
testAutoincrementDetection
()
{
{
$this
->
markTestSkipped
(
$this
->
markTestSkipped
(
...
...
tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php
View file @
b066e54f
...
@@ -81,7 +81,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -81,7 +81,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
insert
(
"nontemporary"
,
array
(
"id"
=>
1
));
$this
->
_conn
->
insert
(
"nontemporary"
,
array
(
"id"
=>
1
));
...
...
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
View file @
b066e54f
...
@@ -39,7 +39,7 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -39,7 +39,7 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
_conn
->
executeQuery
(
$sql
);
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
}
}
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
b066e54f
...
@@ -243,7 +243,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -243,7 +243,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this
->
_platform
->
getDropTableSQL
(
'TABLE'
);
$this
->
_platform
->
getDropTableSQL
(
'TABLE'
);
}
}
public
function
testGetAlterTableSqlDispatchEvent
()
public
function
testGetAlterTableSqlDispatchEvent
()
{
{
$events
=
array
(
$events
=
array
(
...
@@ -335,7 +335,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -335,7 +335,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
{
{
$this
->
markTestSkipped
(
'Platform does not support Column comments.'
);
$this
->
markTestSkipped
(
'Platform does not support Column comments.'
);
}
}
/**
/**
* @group DBAL-45
* @group DBAL-45
*/
*/
...
@@ -343,7 +343,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -343,7 +343,7 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
{
{
$keywordList
=
$this
->
_platform
->
getReservedKeywordsList
();
$keywordList
=
$this
->
_platform
->
getReservedKeywordsList
();
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Platforms\Keywords\KeywordList'
,
$keywordList
);
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Platforms\Keywords\KeywordList'
,
$keywordList
);
$this
->
assertTrue
(
$keywordList
->
isKeyword
(
'table'
));
$this
->
assertTrue
(
$keywordList
->
isKeyword
(
'table'
));
}
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/MySqlPlatformTest.php
View file @
b066e54f
...
@@ -8,7 +8,7 @@ use Doctrine\DBAL\Schema\Table;
...
@@ -8,7 +8,7 @@ use Doctrine\DBAL\Schema\Table;
use
Doctrine\DBAL\Schema\Schema
;
use
Doctrine\DBAL\Schema\Schema
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
MySqlPlatformTest
extends
AbstractPlatformTestCase
class
MySqlPlatformTest
extends
AbstractPlatformTestCase
{
{
public
function
createPlatform
()
public
function
createPlatform
()
...
@@ -129,7 +129,7 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
...
@@ -129,7 +129,7 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
public
function
testDoesSupportSavePoints
()
public
function
testDoesSupportSavePoints
()
{
{
$this
->
assertTrue
(
$this
->
_platform
->
supportsSavepoints
());
$this
->
assertTrue
(
$this
->
_platform
->
supportsSavepoints
());
}
}
public
function
getGenerateIndexSql
()
public
function
getGenerateIndexSql
()
...
@@ -146,27 +146,27 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
...
@@ -146,27 +146,27 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
{
{
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
return
'ALTER TABLE test ADD FOREIGN KEY (fk_name_id) REFERENCES other_table (id)'
;
}
}
/**
/**
* @group DBAL-126
* @group DBAL-126
*/
*/
public
function
testUniquePrimaryKey
()
public
function
testUniquePrimaryKey
()
{
{
$keyTable
=
new
Table
(
"foo"
);
$keyTable
=
new
Table
(
"foo"
);
$keyTable
->
addColumn
(
"bar"
,
"integer"
);
$keyTable
->
addColumn
(
"bar"
,
"integer"
);
$keyTable
->
addColumn
(
"baz"
,
"string"
);
$keyTable
->
addColumn
(
"baz"
,
"string"
);
$keyTable
->
setPrimaryKey
(
array
(
"bar"
));
$keyTable
->
setPrimaryKey
(
array
(
"bar"
));
$keyTable
->
addUniqueIndex
(
array
(
"baz"
));
$keyTable
->
addUniqueIndex
(
array
(
"baz"
));
$oldTable
=
new
Table
(
"foo"
);
$oldTable
=
new
Table
(
"foo"
);
$oldTable
->
addColumn
(
"bar"
,
"integer"
);
$oldTable
->
addColumn
(
"bar"
,
"integer"
);
$oldTable
->
addColumn
(
"baz"
,
"string"
);
$oldTable
->
addColumn
(
"baz"
,
"string"
);
$c
=
new
\Doctrine\DBAL\Schema\Comparator
;
$c
=
new
\Doctrine\DBAL\Schema\Comparator
;
$diff
=
$c
->
diffTable
(
$oldTable
,
$keyTable
);
$diff
=
$c
->
diffTable
(
$oldTable
,
$keyTable
);
$sql
=
$this
->
_platform
->
getAlterTableSQL
(
$diff
);
$sql
=
$this
->
_platform
->
getAlterTableSQL
(
$diff
);
$this
->
assertEquals
(
array
(
$this
->
assertEquals
(
array
(
"ALTER TABLE foo ADD PRIMARY KEY (bar)"
,
"ALTER TABLE foo ADD PRIMARY KEY (bar)"
,
"CREATE UNIQUE INDEX UNIQ_8C73652178240498 ON foo (baz)"
,
"CREATE UNIQUE INDEX UNIQ_8C73652178240498 ON foo (baz)"
,
...
...
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\OraclePlatform;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Type
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
OraclePlatformTest
extends
AbstractPlatformTestCase
class
OraclePlatformTest
extends
AbstractPlatformTestCase
{
{
public
function
createPlatform
()
public
function
createPlatform
()
...
@@ -94,7 +94,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -94,7 +94,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
public
function
testDropTable
()
public
function
testDropTable
()
{
{
$this
->
assertEquals
(
'DROP TABLE foobar'
,
$this
->
_platform
->
getDropTableSQL
(
'foobar'
));
$this
->
assertEquals
(
'DROP TABLE foobar'
,
$this
->
_platform
->
getDropTableSQL
(
'foobar'
));
}
}
public
function
testGeneratesTypeDeclarationForIntegers
()
public
function
testGeneratesTypeDeclarationForIntegers
()
...
@@ -145,9 +145,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -145,9 +145,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase
public
function
testSupportsSavePoints
()
public
function
testSupportsSavePoints
()
{
{
$this
->
assertTrue
(
$this
->
_platform
->
supportsSavepoints
());
$this
->
assertTrue
(
$this
->
_platform
->
supportsSavepoints
());
}
}
public
function
getGenerateIndexSql
()
public
function
getGenerateIndexSql
()
{
{
return
'CREATE INDEX my_idx ON mytable (user_name, last_login)'
;
return
'CREATE INDEX my_idx ON mytable (user_name, last_login)'
;
...
@@ -212,8 +212,8 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -212,8 +212,8 @@ class OraclePlatformTest extends AbstractPlatformTestCase
public
function
getBitOrComparisonExpressionSql
(
$value1
,
$value2
)
public
function
getBitOrComparisonExpressionSql
(
$value1
,
$value2
)
{
{
return
'('
.
$value1
.
'-'
.
return
'('
.
$value1
.
'-'
.
$this
->
getBitAndComparisonExpressionSql
(
$value1
,
$value2
)
$this
->
getBitAndComparisonExpressionSql
(
$value1
,
$value2
)
.
'+'
.
$value2
.
')'
;
.
'+'
.
$value2
.
')'
;
}
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Platforms/PostgreSqlPlatformTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Type
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
PostgreSqlPlatformTest
extends
AbstractPlatformTestCase
class
PostgreSqlPlatformTest
extends
AbstractPlatformTestCase
{
{
public
function
createPlatform
()
public
function
createPlatform
()
...
...
tests/Doctrine/Tests/DBAL/Platforms/ReservedKeywordsValidatorTest.php
View file @
b066e54f
...
@@ -13,32 +13,32 @@ class ReservedKeywordsValidatorTest extends \Doctrine\Tests\DbalTestCase
...
@@ -13,32 +13,32 @@ class ReservedKeywordsValidatorTest extends \Doctrine\Tests\DbalTestCase
* @var ReservedKeywordsValidator
* @var ReservedKeywordsValidator
*/
*/
private
$validator
;
private
$validator
;
public
function
setUp
()
public
function
setUp
()
{
{
$this
->
validator
=
new
ReservedKeywordsValidator
(
array
(
$this
->
validator
=
new
ReservedKeywordsValidator
(
array
(
new
\Doctrine\DBAL\Platforms\Keywords\MySQLKeywords
()
new
\Doctrine\DBAL\Platforms\Keywords\MySQLKeywords
()
));
));
}
}
public
function
testReservedTableName
()
public
function
testReservedTableName
()
{
{
$table
=
new
Table
(
"TABLE"
);
$table
=
new
Table
(
"TABLE"
);
$this
->
validator
->
acceptTable
(
$table
);
$this
->
validator
->
acceptTable
(
$table
);
$this
->
assertEquals
(
$this
->
assertEquals
(
array
(
'Table TABLE keyword violations: MySQL'
),
array
(
'Table TABLE keyword violations: MySQL'
),
$this
->
validator
->
getViolations
()
$this
->
validator
->
getViolations
()
);
);
}
}
public
function
testReservedColumnName
()
public
function
testReservedColumnName
()
{
{
$table
=
new
Table
(
"TABLE"
);
$table
=
new
Table
(
"TABLE"
);
$column
=
$table
->
addColumn
(
'table'
,
'string'
);
$column
=
$table
->
addColumn
(
'table'
,
'string'
);
$this
->
validator
->
acceptColumn
(
$table
,
$column
);
$this
->
validator
->
acceptColumn
(
$table
,
$column
);
$this
->
assertEquals
(
$this
->
assertEquals
(
array
(
'Table TABLE column table keyword violations: MySQL'
),
array
(
'Table TABLE column table keyword violations: MySQL'
),
$this
->
validator
->
getViolations
()
$this
->
validator
->
getViolations
()
...
...
tests/Doctrine/Tests/DBAL/Platforms/SqlitePlatformTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Platforms\SqlitePlatform;
use
Doctrine\DBAL\Types\Type
;
use
Doctrine\DBAL\Types\Type
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
SqlitePlatformTest
extends
AbstractPlatformTestCase
class
SqlitePlatformTest
extends
AbstractPlatformTestCase
{
{
public
function
createPlatform
()
public
function
createPlatform
()
...
@@ -37,19 +37,19 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
...
@@ -37,19 +37,19 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
public
function
testGeneratesTransactionCommands
()
public
function
testGeneratesTransactionCommands
()
{
{
$this
->
assertEquals
(
$this
->
assertEquals
(
'PRAGMA read_uncommitted = 0'
,
'PRAGMA read_uncommitted = 0'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_READ_UNCOMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_READ_UNCOMMITTED
)
);
);
$this
->
assertEquals
(
$this
->
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_READ_COMMITTED
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_READ_COMMITTED
)
);
);
$this
->
assertEquals
(
$this
->
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_REPEATABLE_READ
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_REPEATABLE_READ
)
);
);
$this
->
assertEquals
(
$this
->
assertEquals
(
'PRAGMA read_uncommitted = 1'
,
'PRAGMA read_uncommitted = 1'
,
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_SERIALIZABLE
)
$this
->
_platform
->
getSetTransactionIsolationSQL
(
\Doctrine\DBAL\Connection
::
TRANSACTION_SERIALIZABLE
)
);
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Query/Expression/CompositeExpressionTest.php
View file @
b066e54f
...
@@ -14,67 +14,67 @@ class CompositeExpressionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -14,67 +14,67 @@ class CompositeExpressionTest extends \Doctrine\Tests\DbalTestCase
public
function
testCount
()
public
function
testCount
()
{
{
$expr
=
new
CompositeExpression
(
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
));
$expr
=
new
CompositeExpression
(
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
));
$this
->
assertEquals
(
1
,
count
(
$expr
));
$this
->
assertEquals
(
1
,
count
(
$expr
));
$expr
->
add
(
'u.group_id = 2'
);
$expr
->
add
(
'u.group_id = 2'
);
$this
->
assertEquals
(
2
,
count
(
$expr
));
$this
->
assertEquals
(
2
,
count
(
$expr
));
}
}
/**
/**
* @dataProvider provideDataForConvertToString
* @dataProvider provideDataForConvertToString
*/
*/
public
function
testCompositeUsageAndGeneration
(
$type
,
$parts
,
$expects
)
public
function
testCompositeUsageAndGeneration
(
$type
,
$parts
,
$expects
)
{
{
$expr
=
new
CompositeExpression
(
$type
,
$parts
);
$expr
=
new
CompositeExpression
(
$type
,
$parts
);
$this
->
assertEquals
(
$expects
,
(
string
)
$expr
);
$this
->
assertEquals
(
$expects
,
(
string
)
$expr
);
}
}
public
function
provideDataForConvertToString
()
public
function
provideDataForConvertToString
()
{
{
return
array
(
return
array
(
array
(
array
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
'u.user = 1'
,
'u.group_id = 1'
),
array
(
'u.user = 1'
,
'u.group_id = 1'
),
'(u.user = 1) AND (u.group_id = 1)'
'(u.user = 1) AND (u.group_id = 1)'
),
),
array
(
array
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
'(u.group_id = 1) OR (u.group_id = 2)'
'(u.group_id = 1) OR (u.group_id = 2)'
),
),
array
(
array
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
array
(
'u.user = 1'
,
'u.user = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))'
'(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))'
),
),
array
(
array
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
array
(
'u.group_id = 1'
,
'u.group_id = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
'u.user = 1'
,
'u.group_id = 2'
)
array
(
'u.user = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))'
'(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))'
),
),
);
);
...
...
tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php
View file @
b066e54f
...
@@ -13,140 +13,140 @@ require_once __DIR__ . '/../../../TestInit.php';
...
@@ -13,140 +13,140 @@ require_once __DIR__ . '/../../../TestInit.php';
class
ExpressionBuilderTest
extends
\Doctrine\Tests\DbalTestCase
class
ExpressionBuilderTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
$expr
;
protected
$expr
;
public
function
setUp
()
public
function
setUp
()
{
{
$conn
=
$this
->
getMock
(
'Doctrine\DBAL\Connection'
,
array
(),
array
(),
''
,
false
);
$conn
=
$this
->
getMock
(
'Doctrine\DBAL\Connection'
,
array
(),
array
(),
''
,
false
);
$this
->
expr
=
new
ExpressionBuilder
(
$conn
);
$this
->
expr
=
new
ExpressionBuilder
(
$conn
);
$conn
->
expects
(
$this
->
any
())
$conn
->
expects
(
$this
->
any
())
->
method
(
'getExpressionBuilder'
)
->
method
(
'getExpressionBuilder'
)
->
will
(
$this
->
returnValue
(
$this
->
expr
));
->
will
(
$this
->
returnValue
(
$this
->
expr
));
}
}
/**
/**
* @dataProvider provideDataForAndX
* @dataProvider provideDataForAndX
*/
*/
public
function
testAndX
(
$parts
,
$expected
)
public
function
testAndX
(
$parts
,
$expected
)
{
{
$composite
=
$this
->
expr
->
andX
();
$composite
=
$this
->
expr
->
andX
();
foreach
(
$parts
as
$part
)
{
foreach
(
$parts
as
$part
)
{
$composite
->
add
(
$part
);
$composite
->
add
(
$part
);
}
}
$this
->
assertEquals
(
$expected
,
(
string
)
$composite
);
$this
->
assertEquals
(
$expected
,
(
string
)
$composite
);
}
}
public
function
provideDataForAndX
()
public
function
provideDataForAndX
()
{
{
return
array
(
return
array
(
array
(
array
(
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
array
(
'u.user = 1'
,
'u.group_id = 1'
),
array
(
'u.user = 1'
,
'u.group_id = 1'
),
'(u.user = 1) AND (u.group_id = 1)'
'(u.user = 1) AND (u.group_id = 1)'
),
),
array
(
array
(
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
'(u.group_id = 1) AND (u.group_id = 2)'
'(u.group_id = 1) AND (u.group_id = 2)'
),
),
array
(
array
(
array
(
array
(
'u.user = 1'
,
'u.user = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))'
'(u.user = 1) AND ((u.group_id = 1) OR (u.group_id = 2))'
),
),
array
(
array
(
array
(
array
(
'u.group_id = 1'
,
'u.group_id = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
'u.user = 1'
,
'u.group_id = 2'
)
array
(
'u.user = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.group_id = 1) AND ((u.user = 1) AND (u.group_id = 2))'
'(u.group_id = 1) AND ((u.user = 1) AND (u.group_id = 2))'
),
),
);
);
}
}
/**
/**
* @dataProvider provideDataForOrX
* @dataProvider provideDataForOrX
*/
*/
public
function
testOrX
(
$parts
,
$expected
)
public
function
testOrX
(
$parts
,
$expected
)
{
{
$composite
=
$this
->
expr
->
orX
();
$composite
=
$this
->
expr
->
orX
();
foreach
(
$parts
as
$part
)
{
foreach
(
$parts
as
$part
)
{
$composite
->
add
(
$part
);
$composite
->
add
(
$part
);
}
}
$this
->
assertEquals
(
$expected
,
(
string
)
$composite
);
$this
->
assertEquals
(
$expected
,
(
string
)
$composite
);
}
}
public
function
provideDataForOrX
()
public
function
provideDataForOrX
()
{
{
return
array
(
return
array
(
array
(
array
(
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
array
(
'u.user = 1'
,
'u.group_id = 1'
),
array
(
'u.user = 1'
,
'u.group_id = 1'
),
'(u.user = 1) OR (u.group_id = 1)'
'(u.user = 1) OR (u.group_id = 1)'
),
),
array
(
array
(
array
(
'u.user = 1'
),
array
(
'u.user = 1'
),
'u.user = 1'
'u.user = 1'
),
),
array
(
array
(
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
array
(
'u.group_id = 1'
,
'u.group_id = 2'
),
'(u.group_id = 1) OR (u.group_id = 2)'
'(u.group_id = 1) OR (u.group_id = 2)'
),
),
array
(
array
(
array
(
array
(
'u.user = 1'
,
'u.user = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_OR
,
CompositeExpression
::
TYPE_OR
,
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
array
(
'u.group_id = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.user = 1) OR ((u.group_id = 1) OR (u.group_id = 2))'
'(u.user = 1) OR ((u.group_id = 1) OR (u.group_id = 2))'
),
),
array
(
array
(
array
(
array
(
'u.group_id = 1'
,
'u.group_id = 1'
,
new
CompositeExpression
(
new
CompositeExpression
(
CompositeExpression
::
TYPE_AND
,
CompositeExpression
::
TYPE_AND
,
array
(
'u.user = 1'
,
'u.group_id = 2'
)
array
(
'u.user = 1'
,
'u.group_id = 2'
)
)
)
),
),
'(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))'
'(u.group_id = 1) OR ((u.user = 1) AND (u.group_id = 2))'
),
),
);
);
}
}
/**
/**
* @dataProvider provideDataForComparison
* @dataProvider provideDataForComparison
*/
*/
public
function
testComparison
(
$leftExpr
,
$operator
,
$rightExpr
,
$expected
)
public
function
testComparison
(
$leftExpr
,
$operator
,
$rightExpr
,
$expected
)
{
{
$part
=
$this
->
expr
->
comparison
(
$leftExpr
,
$operator
,
$rightExpr
);
$part
=
$this
->
expr
->
comparison
(
$leftExpr
,
$operator
,
$rightExpr
);
$this
->
assertEquals
(
$expected
,
(
string
)
$part
);
$this
->
assertEquals
(
$expected
,
(
string
)
$part
);
}
}
public
function
provideDataForComparison
()
public
function
provideDataForComparison
()
{
{
return
array
(
return
array
(
...
@@ -158,42 +158,42 @@ class ExpressionBuilderTest extends \Doctrine\Tests\DbalTestCase
...
@@ -158,42 +158,42 @@ class ExpressionBuilderTest extends \Doctrine\Tests\DbalTestCase
array
(
'u.salary'
,
ExpressionBuilder
::
GTE
,
'10000'
,
'u.salary >= 10000'
),
array
(
'u.salary'
,
ExpressionBuilder
::
GTE
,
'10000'
,
'u.salary >= 10000'
),
);
);
}
}
public
function
testEq
()
public
function
testEq
()
{
{
$this
->
assertEquals
(
'u.user_id = 1'
,
$this
->
expr
->
eq
(
'u.user_id'
,
'1'
));
$this
->
assertEquals
(
'u.user_id = 1'
,
$this
->
expr
->
eq
(
'u.user_id'
,
'1'
));
}
}
public
function
testNeq
()
public
function
testNeq
()
{
{
$this
->
assertEquals
(
'u.user_id <> 1'
,
$this
->
expr
->
neq
(
'u.user_id'
,
'1'
));
$this
->
assertEquals
(
'u.user_id <> 1'
,
$this
->
expr
->
neq
(
'u.user_id'
,
'1'
));
}
}
public
function
testLt
()
public
function
testLt
()
{
{
$this
->
assertEquals
(
'u.salary < 10000'
,
$this
->
expr
->
lt
(
'u.salary'
,
'10000'
));
$this
->
assertEquals
(
'u.salary < 10000'
,
$this
->
expr
->
lt
(
'u.salary'
,
'10000'
));
}
}
public
function
testLte
()
public
function
testLte
()
{
{
$this
->
assertEquals
(
'u.salary <= 10000'
,
$this
->
expr
->
lte
(
'u.salary'
,
'10000'
));
$this
->
assertEquals
(
'u.salary <= 10000'
,
$this
->
expr
->
lte
(
'u.salary'
,
'10000'
));
}
}
public
function
testGt
()
public
function
testGt
()
{
{
$this
->
assertEquals
(
'u.salary > 10000'
,
$this
->
expr
->
gt
(
'u.salary'
,
'10000'
));
$this
->
assertEquals
(
'u.salary > 10000'
,
$this
->
expr
->
gt
(
'u.salary'
,
'10000'
));
}
}
public
function
testGte
()
public
function
testGte
()
{
{
$this
->
assertEquals
(
'u.salary >= 10000'
,
$this
->
expr
->
gte
(
'u.salary'
,
'10000'
));
$this
->
assertEquals
(
'u.salary >= 10000'
,
$this
->
expr
->
gte
(
'u.salary'
,
'10000'
));
}
}
public
function
testIsNull
()
public
function
testIsNull
()
{
{
$this
->
assertEquals
(
'u.deleted IS NULL'
,
$this
->
expr
->
isNull
(
'u.deleted'
));
$this
->
assertEquals
(
'u.deleted IS NULL'
,
$this
->
expr
->
isNull
(
'u.deleted'
));
}
}
public
function
testIsNotNull
()
public
function
testIsNotNull
()
{
{
$this
->
assertEquals
(
'u.updated IS NOT NULL'
,
$this
->
expr
->
isNotNull
(
'u.updated'
));
$this
->
assertEquals
(
'u.updated IS NOT NULL'
,
$this
->
expr
->
isNotNull
(
'u.updated'
));
...
...
tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php
View file @
b066e54f
...
@@ -19,7 +19,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -19,7 +19,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
// none
// none
array
(
'SELECT * FROM Foo'
,
true
,
array
()),
array
(
'SELECT * FROM Foo'
,
true
,
array
()),
array
(
'SELECT * FROM Foo'
,
false
,
array
()),
array
(
'SELECT * FROM Foo'
,
false
,
array
()),
// Positionals
// Positionals
array
(
'SELECT ?'
,
true
,
array
(
7
)),
array
(
'SELECT ?'
,
true
,
array
(
7
)),
array
(
'SELECT * FROM Foo WHERE bar IN (?, ?, ?)'
,
true
,
array
(
32
,
35
,
38
)),
array
(
'SELECT * FROM Foo WHERE bar IN (?, ?, ?)'
,
true
,
array
(
32
,
35
,
38
)),
...
@@ -28,7 +28,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -28,7 +28,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array
(
"SELECT '?' FROM foo"
,
true
,
array
()),
array
(
"SELECT '?' FROM foo"
,
true
,
array
()),
array
(
'SELECT "?" FROM foo WHERE bar = ?'
,
true
,
array
(
32
)),
array
(
'SELECT "?" FROM foo WHERE bar = ?'
,
true
,
array
(
32
)),
array
(
"SELECT '?' FROM foo WHERE bar = ?"
,
true
,
array
(
32
)),
array
(
"SELECT '?' FROM foo WHERE bar = ?"
,
true
,
array
(
32
)),
// named
// named
array
(
'SELECT :foo FROM :bar'
,
false
,
array
(
':foo'
=>
array
(
7
),
':bar'
=>
array
(
17
))),
array
(
'SELECT :foo FROM :bar'
,
false
,
array
(
':foo'
=>
array
(
7
),
':bar'
=>
array
(
17
))),
array
(
'SELECT * FROM Foo WHERE bar IN (:name1, :name2)'
,
false
,
array
(
':name1'
=>
array
(
32
),
':name2'
=>
array
(
40
))),
array
(
'SELECT * FROM Foo WHERE bar IN (:name1, :name2)'
,
false
,
array
(
':name1'
=>
array
(
32
),
':name2'
=>
array
(
40
))),
...
@@ -36,7 +36,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -36,7 +36,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array
(
"SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)"
,
false
,
array
(
':name1'
=>
array
(
37
),
':name2'
=>
array
(
45
))),
array
(
"SELECT ':foo' FROM Foo WHERE bar IN (:name1, :name2)"
,
false
,
array
(
':name1'
=>
array
(
37
),
':name2'
=>
array
(
45
))),
);
);
}
}
/**
/**
* @dataProvider dataGetPlaceholderPositions
* @dataProvider dataGetPlaceholderPositions
* @param type $query
* @param type $query
...
@@ -48,7 +48,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -48,7 +48,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
$actualParamPos
=
SQLParserUtils
::
getPlaceholderPositions
(
$query
,
$isPositional
);
$actualParamPos
=
SQLParserUtils
::
getPlaceholderPositions
(
$query
,
$isPositional
);
$this
->
assertEquals
(
$expectedParamPos
,
$actualParamPos
);
$this
->
assertEquals
(
$expectedParamPos
,
$actualParamPos
);
}
}
static
public
function
dataExpandListParameters
()
static
public
function
dataExpandListParameters
()
{
{
return
array
(
return
array
(
...
@@ -106,7 +106,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -106,7 +106,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array
(
1
),
array
(
1
),
array
(
\PDO
::
PARAM_INT
)
array
(
\PDO
::
PARAM_INT
)
),
),
// Named parameters : Very simple with param int and string
// Named parameters : Very simple with param int and string
array
(
array
(
"SELECT * FROM Foo WHERE foo = :foo AND bar = :bar"
,
"SELECT * FROM Foo WHERE foo = :foo AND bar = :bar"
,
...
@@ -116,7 +116,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -116,7 +116,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
array
(
1
,
'Some String'
),
array
(
1
,
'Some String'
),
array
(
\PDO
::
PARAM_INT
,
\PDO
::
PARAM_STR
)
array
(
\PDO
::
PARAM_INT
,
\PDO
::
PARAM_STR
)
),
),
// Named parameters : Very simple with one needle
// Named parameters : Very simple with one needle
array
(
array
(
"SELECT * FROM Foo WHERE foo IN (:foo)"
,
"SELECT * FROM Foo WHERE foo IN (:foo)"
,
...
@@ -182,7 +182,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -182,7 +182,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
),
),
);
);
}
}
/**
/**
* @dataProvider dataExpandListParameters
* @dataProvider dataExpandListParameters
* @param type $q
* @param type $q
...
@@ -195,7 +195,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
...
@@ -195,7 +195,7 @@ class SQLParserUtilsTest extends \Doctrine\Tests\DbalTestCase
public
function
testExpandListParameters
(
$q
,
$p
,
$t
,
$expectedQuery
,
$expectedParams
,
$expectedTypes
)
public
function
testExpandListParameters
(
$q
,
$p
,
$t
,
$expectedQuery
,
$expectedParams
,
$expectedTypes
)
{
{
list
(
$query
,
$params
,
$types
)
=
SQLParserUtils
::
expandListParameters
(
$q
,
$p
,
$t
);
list
(
$query
,
$params
,
$types
)
=
SQLParserUtils
::
expandListParameters
(
$q
,
$p
,
$t
);
$this
->
assertEquals
(
$expectedQuery
,
$query
,
"Query was not rewritten correctly."
);
$this
->
assertEquals
(
$expectedQuery
,
$query
,
"Query was not rewritten correctly."
);
$this
->
assertEquals
(
$expectedParams
,
$params
,
"Params dont match"
);
$this
->
assertEquals
(
$expectedParams
,
$params
,
"Params dont match"
);
$this
->
assertEquals
(
$expectedTypes
,
$types
,
"Types dont match"
);
$this
->
assertEquals
(
$expectedTypes
,
$types
,
"Types dont match"
);
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
b066e54f
...
@@ -89,12 +89,12 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -89,12 +89,12 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$schemaConfig
=
new
\Doctrine\DBAL\Schema\SchemaConfig
;
$schemaConfig
=
new
\Doctrine\DBAL\Schema\SchemaConfig
;
$table
=
new
Table
(
'bugdb'
,
array
(
'integerfield1'
=>
new
Column
(
'integerfield1'
,
Type
::
getType
(
'integer'
))));
$table
=
new
Table
(
'bugdb'
,
array
(
'integerfield1'
=>
new
Column
(
'integerfield1'
,
Type
::
getType
(
'integer'
))));
$table
->
setSchemaConfig
(
$schemaConfig
);
$table
->
setSchemaConfig
(
$schemaConfig
);
$schema1
=
new
Schema
(
array
(
$table
),
array
(),
$schemaConfig
);
$schema1
=
new
Schema
(
array
(
$table
),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$expected
=
new
SchemaDiff
(
array
(),
array
(),
array
(
'bugdb'
=>
$table
)
);
$expected
=
new
SchemaDiff
(
array
(),
array
(),
array
(
'bugdb'
=>
$table
)
);
$this
->
assertEquals
(
$expected
,
Comparator
::
compareSchemas
(
$schema1
,
$schema2
)
);
$this
->
assertEquals
(
$expected
,
Comparator
::
compareSchemas
(
$schema1
,
$schema2
)
);
}
}
...
@@ -200,7 +200,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -200,7 +200,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$column1
->
setCustomSchemaOption
(
'foo'
,
'bar'
);
$column1
->
setCustomSchemaOption
(
'foo'
,
'bar'
);
$column2
->
setCustomSchemaOption
(
'foo'
,
'bar'
);
$column2
->
setCustomSchemaOption
(
'foo'
,
'bar'
);
$column1
->
setCustomSchemaOption
(
'foo1'
,
'bar1'
);
$column1
->
setCustomSchemaOption
(
'foo1'
,
'bar1'
);
$column2
->
setCustomSchemaOption
(
'foo2'
,
'bar2'
);
$column2
->
setCustomSchemaOption
(
'foo2'
,
'bar2'
);
...
@@ -518,7 +518,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -518,7 +518,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$schemaB
->
createSequence
(
'Bar'
);
$schemaB
->
createSequence
(
'Bar'
);
$schemaB
->
createSequence
(
'baz'
);
$schemaB
->
createSequence
(
'baz'
);
$schemaB
->
createSequence
(
'old'
);
$schemaB
->
createSequence
(
'old'
);
$c
=
new
Comparator
();
$c
=
new
Comparator
();
$diff
=
$c
->
compare
(
$schemaA
,
$schemaB
);
$diff
=
$c
->
compare
(
$schemaA
,
$schemaB
);
...
@@ -612,7 +612,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -612,7 +612,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$tableB
=
new
Table
(
"foo"
);
$tableB
=
new
Table
(
"foo"
);
$tableB
->
addColumn
(
'baz'
,
'integer'
);
$tableB
->
addColumn
(
'baz'
,
'integer'
);
$c
=
new
Comparator
();
$c
=
new
Comparator
();
$tableDiff
=
$c
->
diffTable
(
$tableA
,
$tableB
);
$tableDiff
=
$c
->
diffTable
(
$tableA
,
$tableB
);
...
@@ -668,8 +668,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -668,8 +668,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
array
(
'logged_in_at'
),
array_keys
(
$tableDiff
->
addedColumns
));
$this
->
assertEquals
(
array
(
'logged_in_at'
),
array_keys
(
$tableDiff
->
addedColumns
));
$this
->
assertEquals
(
0
,
count
(
$tableDiff
->
removedColumns
));
$this
->
assertEquals
(
0
,
count
(
$tableDiff
->
removedColumns
));
}
}
/**
/**
* @group DBAL-112
* @group DBAL-112
*/
*/
...
@@ -677,14 +677,14 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
...
@@ -677,14 +677,14 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
{
{
$schema
=
new
Schema
();
$schema
=
new
Schema
();
$sequence
=
$schema
->
createSequence
(
'baz'
);
$sequence
=
$schema
->
createSequence
(
'baz'
);
$schemaNew
=
clone
$schema
;
$schemaNew
=
clone
$schema
;
/* @var $schemaNew Schema */
/* @var $schemaNew Schema */
$schemaNew
->
getSequence
(
'baz'
)
->
setAllocationSize
(
20
);
$schemaNew
->
getSequence
(
'baz'
)
->
setAllocationSize
(
20
);
$c
=
new
\Doctrine\DBAL\Schema\Comparator
;
$c
=
new
\Doctrine\DBAL\Schema\Comparator
;
$diff
=
$c
->
compare
(
$schema
,
$schemaNew
);
$diff
=
$c
->
compare
(
$schema
,
$schemaNew
);
$this
->
assertSame
(
$diff
->
changedSequences
[
0
]
,
$schemaNew
->
getSequence
(
'baz'
));
$this
->
assertSame
(
$diff
->
changedSequences
[
0
]
,
$schemaNew
->
getSequence
(
'baz'
));
}
}
...
...
tests/Doctrine/Tests/DBAL/Types/ArrayTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
ArrayTest
extends
\Doctrine\Tests\DbalTestCase
class
ArrayTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/BooleanTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
BooleanTest
extends
\Doctrine\Tests\DbalTestCase
class
BooleanTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/DateTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
DateTest
extends
\Doctrine\Tests\DbalTestCase
class
DateTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
@@ -61,7 +61,7 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
...
@@ -61,7 +61,7 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
$this
->
assertEquals
(
'00:00:00'
,
$date
->
format
(
'H:i:s'
));
$this
->
assertEquals
(
'00:00:00'
,
$date
->
format
(
'H:i:s'
));
$this
->
assertEquals
(
'2009-11-01'
,
$date
->
format
(
'Y-m-d'
));
$this
->
assertEquals
(
'2009-11-01'
,
$date
->
format
(
'Y-m-d'
));
}
}
public
function
testInvalidDateFormatConversion
()
public
function
testInvalidDateFormatConversion
()
{
{
$this
->
setExpectedException
(
'Doctrine\DBAL\Types\ConversionException'
);
$this
->
setExpectedException
(
'Doctrine\DBAL\Types\ConversionException'
);
...
...
tests/Doctrine/Tests/DBAL/Types/DecimalTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
DecimalTest
extends
\Doctrine\Tests\DbalTestCase
class
DecimalTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
ObjectTest
extends
\Doctrine\Tests\DbalTestCase
class
ObjectTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
SmallIntTest
extends
\Doctrine\Tests\DbalTestCase
class
SmallIntTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/StringTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
StringTest
extends
\Doctrine\Tests\DbalTestCase
class
StringTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/DBAL/Types/TimeTest.php
View file @
b066e54f
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
...
@@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\Tests\DBAL\Mocks
;
use
Doctrine\Tests\DBAL\Mocks
;
require_once
__DIR__
.
'/../../TestInit.php'
;
require_once
__DIR__
.
'/../../TestInit.php'
;
class
TimeTest
extends
\Doctrine\Tests\DbalTestCase
class
TimeTest
extends
\Doctrine\Tests\DbalTestCase
{
{
protected
protected
...
...
tests/Doctrine/Tests/Mocks/DriverMock.php
View file @
b066e54f
...
@@ -13,7 +13,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
...
@@ -13,7 +13,7 @@ class DriverMock implements \Doctrine\DBAL\Driver
{
{
return
new
DriverConnectionMock
();
return
new
DriverConnectionMock
();
}
}
/**
/**
* Constructs the Sqlite PDO DSN.
* Constructs the Sqlite PDO DSN.
*
*
...
...
tests/Doctrine/Tests/Mocks/HydratorMockStatement.php
View file @
b066e54f
...
@@ -10,8 +10,8 @@ namespace Doctrine\Tests\Mocks;
...
@@ -10,8 +10,8 @@ namespace Doctrine\Tests\Mocks;
*/
*/
class
HydratorMockStatement
implements
\Doctrine\DBAL\Driver\Statement
class
HydratorMockStatement
implements
\Doctrine\DBAL\Driver\Statement
{
{
private
$_resultSet
;
private
$_resultSet
;
/**
/**
* Creates a new mock statement that will serve the provided fake result set to clients.
* Creates a new mock statement that will serve the provided fake result set to clients.
*
*
...
@@ -21,7 +21,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -21,7 +21,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
{
{
$this
->
_resultSet
=
$resultSet
;
$this
->
_resultSet
=
$resultSet
;
}
}
/**
/**
* Fetches all rows from the result set.
* Fetches all rows from the result set.
*
*
...
@@ -31,7 +31,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -31,7 +31,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
{
{
return
$this
->
_resultSet
;
return
$this
->
_resultSet
;
}
}
public
function
fetchColumn
(
$columnNumber
=
0
)
public
function
fetchColumn
(
$columnNumber
=
0
)
{
{
$row
=
current
(
$this
->
_resultSet
);
$row
=
current
(
$this
->
_resultSet
);
...
@@ -39,10 +39,10 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -39,10 +39,10 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
$val
=
array_shift
(
$row
);
$val
=
array_shift
(
$row
);
return
$val
!==
null
?
$val
:
false
;
return
$val
!==
null
?
$val
:
false
;
}
}
/**
/**
* Fetches the next row in the result set.
* Fetches the next row in the result set.
*
*
*/
*/
public
function
fetch
(
$fetchStyle
=
null
)
public
function
fetch
(
$fetchStyle
=
null
)
{
{
...
@@ -50,7 +50,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -50,7 +50,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
next
(
$this
->
_resultSet
);
next
(
$this
->
_resultSet
);
return
$current
;
return
$current
;
}
}
/**
/**
* Closes the cursor, enabling the statement to be executed again.
* Closes the cursor, enabling the statement to be executed again.
*
*
...
@@ -60,13 +60,13 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -60,13 +60,13 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
{
{
return
true
;
return
true
;
}
}
public
function
setResultSet
(
array
$resultSet
)
public
function
setResultSet
(
array
$resultSet
)
{
{
reset
(
$resultSet
);
reset
(
$resultSet
);
$this
->
_resultSet
=
$resultSet
;
$this
->
_resultSet
=
$resultSet
;
}
}
public
function
bindColumn
(
$column
,
&
$param
,
$type
=
null
)
public
function
bindColumn
(
$column
,
&
$param
,
$type
=
null
)
{
{
}
}
...
@@ -78,7 +78,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -78,7 +78,7 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
null
,
$length
=
null
,
$driverOptions
=
array
())
public
function
bindParam
(
$column
,
&
$variable
,
$type
=
null
,
$length
=
null
,
$driverOptions
=
array
())
{
{
}
}
public
function
columnCount
()
public
function
columnCount
()
{
{
}
}
...
@@ -86,16 +86,16 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
...
@@ -86,16 +86,16 @@ class HydratorMockStatement implements \Doctrine\DBAL\Driver\Statement
public
function
errorCode
()
public
function
errorCode
()
{
{
}
}
public
function
errorInfo
()
public
function
errorInfo
()
{
{
}
}
public
function
execute
(
$params
=
array
())
public
function
execute
(
$params
=
array
())
{
{
}
}
public
function
rowCount
()
public
function
rowCount
()
{
{
}
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/Mocks/SchemaManagerMock.php
View file @
b066e54f
...
@@ -8,6 +8,6 @@ class SchemaManagerMock extends \Doctrine\DBAL\Schema\AbstractSchemaManager
...
@@ -8,6 +8,6 @@ class SchemaManagerMock extends \Doctrine\DBAL\Schema\AbstractSchemaManager
{
{
parent
::
__construct
(
$conn
);
parent
::
__construct
(
$conn
);
}
}
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{}
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{}
}
}
\ No newline at end of file
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