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
300a8e59
Unverified
Commit
300a8e59
authored
Apr 02, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed dynamic calls to static methods
parent
4edcd154
Changes
91
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
91 changed files
with
486 additions
and
487 deletions
+486
-487
ConnectionTest.php
tests/ConnectionTest.php
+75
-75
AbstractDriverTest.php
tests/Driver/AbstractDriverTest.php
+5
-5
AbstractMySQLDriverTest.php
tests/Driver/AbstractMySQLDriverTest.php
+6
-6
EasyConnectStringTest.php
tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php
+1
-1
AbstractOracleDriverTest.php
tests/Driver/AbstractOracleDriverTest.php
+4
-4
AbstractPostgreSQLDriverTest.php
tests/Driver/AbstractPostgreSQLDriverTest.php
+6
-6
AbstractSQLiteDriverTest.php
tests/Driver/AbstractSQLiteDriverTest.php
+2
-2
MysqliConnectionTest.php
tests/Driver/Mysqli/MysqliConnectionTest.php
+1
-1
OCI8StatementTest.php
tests/Driver/OCI8/OCI8StatementTest.php
+10
-10
StatementIteratorTest.php
tests/Driver/StatementIteratorTest.php
+5
-5
MysqlSessionInitTest.php
tests/Events/MysqlSessionInitTest.php
+2
-2
OracleSessionInitTest.php
tests/Events/OracleSessionInitTest.php
+4
-4
SQLSessionInitTest.php
tests/Events/SQLSessionInitTest.php
+2
-2
BlobTest.php
tests/Functional/BlobTest.php
+4
-4
ConnectionTest.php
tests/Functional/ConnectionTest.php
+13
-14
DataAccessTest.php
tests/Functional/DataAccessTest.php
+8
-8
DB2DriverTest.php
tests/Functional/Driver/IBMDB2/DB2DriverTest.php
+4
-4
DB2StatementTest.php
tests/Functional/Driver/IBMDB2/DB2StatementTest.php
+2
-2
ConnectionTest.php
tests/Functional/Driver/Mysqli/ConnectionTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/Mysqli/DriverTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/OCI8/DriverTest.php
+4
-4
OCI8ConnectionTest.php
tests/Functional/Driver/OCI8/OCI8ConnectionTest.php
+2
-2
StatementTest.php
tests/Functional/Driver/OCI8/StatementTest.php
+2
-2
PDOConnectionTest.php
tests/Functional/Driver/PDOConnectionTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDOMySql/DriverTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDOOracle/DriverTest.php
+4
-4
DriverTest.php
tests/Functional/Driver/PDOPgSql/DriverTest.php
+3
-3
PDOPgsqlConnectionTest.php
tests/Functional/Driver/PDOPgsqlConnectionTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDOSqlite/DriverTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/PDOSqlsrv/DriverTest.php
+2
-2
ConnectionTest.php
tests/Functional/Driver/SQLAnywhere/ConnectionTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/SQLAnywhere/DriverTest.php
+2
-2
StatementTest.php
tests/Functional/Driver/SQLAnywhere/StatementTest.php
+2
-2
DriverTest.php
tests/Functional/Driver/SQLSrv/DriverTest.php
+2
-2
ExceptionTest.php
tests/Functional/ExceptionTest.php
+5
-5
LikeWildcardsEscapingTest.php
tests/Functional/LikeWildcardsEscapingTest.php
+1
-1
LoggingTest.php
tests/Functional/LoggingTest.php
+9
-9
MasterSlaveConnectionTest.php
tests/Functional/MasterSlaveConnectionTest.php
+1
-1
NamedParametersTest.php
tests/Functional/NamedParametersTest.php
+1
-1
NewPrimaryKeyWithNewAutoIncrementColumnTest.php
.../Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
+5
-5
MySqlSchemaManagerTest.php
tests/Functional/Schema/MySqlSchemaManagerTest.php
+2
-2
PostgreSqlSchemaManagerTest.php
tests/Functional/Schema/PostgreSqlSchemaManagerTest.php
+1
-1
SchemaManagerFunctionalTestCase.php
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
+30
-30
SqliteSchemaManagerTest.php
tests/Functional/Schema/SqliteSchemaManagerTest.php
+3
-3
StatementTest.php
tests/Functional/StatementTest.php
+4
-4
TableGeneratorTest.php
tests/Functional/TableGeneratorTest.php
+1
-1
TemporaryTableTest.php
tests/Functional/TemporaryTableTest.php
+2
-2
DBAL168Test.php
tests/Functional/Ticket/DBAL168Test.php
+1
-1
DBAL202Test.php
tests/Functional/Ticket/DBAL202Test.php
+1
-1
DBAL461Test.php
tests/Functional/Ticket/DBAL461Test.php
+1
-1
DBAL510Test.php
tests/Functional/Ticket/DBAL510Test.php
+1
-1
DBAL630Test.php
tests/Functional/Ticket/DBAL630Test.php
+1
-1
DBAL752Test.php
tests/Functional/Ticket/DBAL752Test.php
+1
-1
TransactionTest.php
tests/Functional/TransactionTest.php
+2
-2
TypeConversionTest.php
tests/Functional/TypeConversionTest.php
+1
-1
BinaryTest.php
tests/Functional/Types/BinaryTest.php
+3
-3
WriteTest.php
tests/Functional/WriteTest.php
+5
-5
LoggerChainTest.php
tests/Logging/LoggerChainTest.php
+1
-1
AbstractPlatformTestCase.php
tests/Platforms/AbstractPlatformTestCase.php
+16
-16
AbstractPostgreSQLPlatformTestCase.php
tests/Platforms/AbstractPostgreSQLPlatformTestCase.php
+2
-2
AbstractSQLServerPlatformTestCase.php
tests/Platforms/AbstractSQLServerPlatformTestCase.php
+1
-1
DB2PlatformTest.php
tests/Platforms/DB2PlatformTest.php
+1
-1
MariaDb1027PlatformTest.php
tests/Platforms/MariaDb1027PlatformTest.php
+1
-1
OraclePlatformTest.php
tests/Platforms/OraclePlatformTest.php
+1
-1
SQLAnywhere16PlatformTest.php
tests/Platforms/SQLAnywhere16PlatformTest.php
+1
-1
SqlitePlatformTest.php
tests/Platforms/SqlitePlatformTest.php
+2
-2
StatementTest.php
tests/Portability/StatementTest.php
+19
-19
ExpressionBuilderTest.php
tests/Query/Expression/ExpressionBuilderTest.php
+2
-2
QueryBuilderTest.php
tests/Query/QueryBuilderTest.php
+2
-2
ComparatorTest.php
tests/Schema/ComparatorTest.php
+12
-12
DB2SchemaManagerTest.php
tests/Schema/DB2SchemaManagerTest.php
+10
-10
ForeignKeyConstraintTest.php
tests/Schema/ForeignKeyConstraintTest.php
+2
-2
MySqlSchemaManagerTest.php
tests/Schema/MySqlSchemaManagerTest.php
+1
-1
SchemaDiffTest.php
tests/Schema/SchemaDiffTest.php
+33
-33
SchemaTest.php
tests/Schema/SchemaTest.php
+18
-18
TableDiffTest.php
tests/Schema/TableDiffTest.php
+2
-2
CreateSchemaSqlCollectorTest.php
tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php
+10
-10
DropSchemaSqlCollectorTest.php
tests/Schema/Visitor/DropSchemaSqlCollectorTest.php
+9
-9
SchemaSqlCollectorTest.php
tests/Schema/Visitor/SchemaSqlCollectorTest.php
+12
-12
StatementTest.php
tests/StatementTest.php
+23
-23
RunSqlCommandTest.php
tests/Tools/Console/RunSqlCommandTest.php
+7
-7
BinaryTest.php
tests/Types/BinaryTest.php
+1
-1
DateImmutableTypeTest.php
tests/Types/DateImmutableTypeTest.php
+4
-4
DateTimeImmutableTypeTest.php
tests/Types/DateTimeImmutableTypeTest.php
+5
-5
DateTimeTzImmutableTypeTest.php
tests/Types/DateTimeTzImmutableTypeTest.php
+4
-4
GuidTypeTest.php
tests/Types/GuidTypeTest.php
+2
-2
JsonArrayTest.php
tests/Types/JsonArrayTest.php
+1
-1
JsonTest.php
tests/Types/JsonTest.php
+1
-1
StringTest.php
tests/Types/StringTest.php
+2
-2
TimeImmutableTypeTest.php
tests/Types/TimeImmutableTypeTest.php
+4
-4
VarDateTimeImmutableTypeTest.php
tests/Types/VarDateTimeImmutableTypeTest.php
+1
-1
No files found.
tests/ConnectionTest.php
View file @
300a8e59
This diff is collapsed.
Click to expand it.
tests/Driver/AbstractDriverTest.php
View file @
300a8e59
...
...
@@ -76,7 +76,7 @@ abstract class AbstractDriverTest extends TestCase
public
function
testConvertsException
(
$errorCode
,
?
string
$sqlState
,
?
string
$message
,
string
$expectedClass
)
:
void
{
if
(
!
$this
->
driver
instanceof
ExceptionConverterDriver
)
{
$this
->
markTestSkipped
(
'This test is only intended for exception converter drivers.'
);
self
::
markTestSkipped
(
'This test is only intended for exception converter drivers.'
);
}
/** @var DriverExceptionInterface|MockObject $driverException */
...
...
@@ -102,7 +102,7 @@ abstract class AbstractDriverTest extends TestCase
public
function
testCreatesDatabasePlatformForVersion
()
:
void
{
if
(
!
$this
->
driver
instanceof
VersionAwarePlatformDriver
)
{
$this
->
markTestSkipped
(
'This test is only intended for version aware platform drivers.'
);
self
::
markTestSkipped
(
'This test is only intended for version aware platform drivers.'
);
}
$data
=
$this
->
getDatabasePlatformsForVersions
();
...
...
@@ -135,7 +135,7 @@ abstract class AbstractDriverTest extends TestCase
public
function
testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion
()
:
void
{
if
(
!
$this
->
driver
instanceof
VersionAwarePlatformDriver
)
{
$this
->
markTestSkipped
(
'This test is only intended for version aware platform drivers.'
);
self
::
markTestSkipped
(
'This test is only intended for version aware platform drivers.'
);
}
$this
->
expectException
(
DBALException
::
class
);
...
...
@@ -152,9 +152,9 @@ abstract class AbstractDriverTest extends TestCase
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
self
::
assertSame
(
$params
[
'dbname'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
tests/Driver/AbstractMySQLDriverTest.php
View file @
300a8e59
...
...
@@ -28,19 +28,19 @@ class AbstractMySQLDriverTest extends AbstractDriverTest
$statement
=
$this
->
createMock
(
ResultStatement
::
class
);
$statement
->
expects
(
$this
->
once
())
$statement
->
expects
(
self
::
once
())
->
method
(
'fetchColumn'
)
->
will
(
$this
->
returnValue
(
$database
));
->
will
(
self
::
returnValue
(
$database
));
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'query'
)
->
will
(
$this
->
returnValue
(
$statement
));
->
will
(
self
::
returnValue
(
$statement
));
self
::
assertSame
(
$database
,
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
tests/Driver/AbstractOracleDriver/EasyConnectStringTest.php
View file @
300a8e59
...
...
@@ -16,7 +16,7 @@ class EasyConnectStringTest extends TestCase
{
$string
=
EasyConnectString
::
fromConnectionParameters
(
$params
);
$this
->
assertSame
(
$expected
,
(
string
)
$string
);
self
::
assertSame
(
$expected
,
(
string
)
$string
);
}
/**
...
...
tests/Driver/AbstractOracleDriverTest.php
View file @
300a8e59
...
...
@@ -22,9 +22,9 @@ class AbstractOracleDriverTest extends AbstractDriverTest
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
self
::
assertSame
(
$params
[
'user'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
@@ -41,9 +41,9 @@ class AbstractOracleDriverTest extends AbstractDriverTest
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
self
::
assertSame
(
$params
[
'user'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
tests/Driver/AbstractPostgreSQLDriverTest.php
View file @
300a8e59
...
...
@@ -26,19 +26,19 @@ class AbstractPostgreSQLDriverTest extends AbstractDriverTest
$statement
=
$this
->
createMock
(
ResultStatement
::
class
);
$statement
->
expects
(
$this
->
once
())
$statement
->
expects
(
self
::
once
())
->
method
(
'fetchColumn'
)
->
will
(
$this
->
returnValue
(
$database
));
->
will
(
self
::
returnValue
(
$database
));
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'query'
)
->
will
(
$this
->
returnValue
(
$statement
));
->
will
(
self
::
returnValue
(
$statement
));
self
::
assertSame
(
$database
,
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
tests/Driver/AbstractSQLiteDriverTest.php
View file @
300a8e59
...
...
@@ -23,9 +23,9 @@ class AbstractSQLiteDriverTest extends AbstractDriverTest
$connection
=
$this
->
getConnectionMock
();
$connection
->
expects
(
$this
->
once
())
$connection
->
expects
(
self
::
once
())
->
method
(
'getParams'
)
->
will
(
$this
->
returnValue
(
$params
));
->
will
(
self
::
returnValue
(
$params
));
self
::
assertSame
(
$params
[
'path'
],
$this
->
driver
->
getDatabase
(
$connection
));
}
...
...
tests/Driver/Mysqli/MysqliConnectionTest.php
View file @
300a8e59
...
...
@@ -23,7 +23,7 @@ class MysqliConnectionTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'mysqli'
))
{
$this
->
markTestSkipped
(
'mysqli is not installed.'
);
self
::
markTestSkipped
(
'mysqli is not installed.'
);
}
parent
::
setUp
();
...
...
tests/Driver/OCI8/OCI8StatementTest.php
View file @
300a8e59
...
...
@@ -40,23 +40,23 @@ class OCI8StatementTest extends TestCase
->
disableOriginalConstructor
()
->
getMock
();
$statement
->
expects
(
$this
->
at
(
0
))
$statement
->
expects
(
self
::
at
(
0
))
->
method
(
'bindValue'
)
->
with
(
$this
->
equalTo
(
1
),
$this
->
equalTo
(
$params
[
0
])
self
::
equalTo
(
1
),
self
::
equalTo
(
$params
[
0
])
);
$statement
->
expects
(
$this
->
at
(
1
))
$statement
->
expects
(
self
::
at
(
1
))
->
method
(
'bindValue'
)
->
with
(
$this
->
equalTo
(
2
),
$this
->
equalTo
(
$params
[
1
])
self
::
equalTo
(
2
),
self
::
equalTo
(
$params
[
1
])
);
$statement
->
expects
(
$this
->
at
(
2
))
$statement
->
expects
(
self
::
at
(
2
))
->
method
(
'bindValue'
)
->
with
(
$this
->
equalTo
(
3
),
$this
->
equalTo
(
$params
[
2
])
self
::
equalTo
(
3
),
self
::
equalTo
(
$params
[
2
])
);
// the return value is irrelevant to the test
...
...
@@ -70,7 +70,7 @@ class OCI8StatementTest extends TestCase
->
onlyMethods
([
'getExecuteMode'
])
->
disableOriginalConstructor
()
->
getMock
();
$conn
->
expects
(
$this
->
once
())
$conn
->
expects
(
self
::
once
())
->
method
(
'getExecuteMode'
);
$reflProperty
=
new
ReflectionProperty
(
$statement
,
'_conn'
);
...
...
tests/Driver/StatementIteratorTest.php
View file @
300a8e59
...
...
@@ -25,9 +25,9 @@ class StatementIteratorTest extends TestCase
{
/** @var IteratorAggregate|MockObject $stmt */
$stmt
=
$this
->
createPartialMock
(
$class
,
[
'fetch'
,
'fetchAll'
,
'fetchColumn'
]);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetch'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchAll'
);
$stmt
->
expects
(
$this
->
never
())
->
method
(
'fetchColumn'
);
$stmt
->
expects
(
self
::
never
())
->
method
(
'fetch'
);
$stmt
->
expects
(
self
::
never
())
->
method
(
'fetchAll'
);
$stmt
->
expects
(
self
::
never
())
->
method
(
'fetchColumn'
);
$stmt
->
getIterator
();
}
...
...
@@ -61,7 +61,7 @@ class StatementIteratorTest extends TestCase
$values
=
[
'foo'
,
''
,
'bar'
,
'0'
,
'baz'
,
0
,
'qux'
,
null
,
'quz'
,
false
,
'impossible'
];
$calls
=
0
;
$stmt
->
expects
(
$this
->
exactly
(
10
))
$stmt
->
expects
(
self
::
exactly
(
10
))
->
method
(
'fetch'
)
->
willReturnCallback
(
static
function
()
use
(
$values
,
&
$calls
)
{
$value
=
$values
[
$calls
];
...
...
@@ -74,7 +74,7 @@ class StatementIteratorTest extends TestCase
private
function
assertIterationCallsFetchOncePerStep
(
Traversable
$iterator
,
int
&
$calls
)
:
void
{
foreach
(
$iterator
as
$i
=>
$_
)
{
$this
->
assertEquals
(
$i
+
1
,
$calls
);
self
::
assertEquals
(
$i
+
1
,
$calls
);
}
}
...
...
tests/Events/MysqlSessionInitTest.php
View file @
300a8e59
...
...
@@ -13,9 +13,9 @@ class MysqlSessionInitTest extends TestCase
public
function
testPostConnect
()
:
void
{
$connectionMock
=
$this
->
createMock
(
Connection
::
class
);
$connectionMock
->
expects
(
$this
->
once
())
$connectionMock
->
expects
(
self
::
once
())
->
method
(
'executeUpdate'
)
->
with
(
$this
->
equalTo
(
'SET NAMES foo COLLATE bar'
));
->
with
(
self
::
equalTo
(
'SET NAMES foo COLLATE bar'
));
$eventArgs
=
new
ConnectionEventArgs
(
$connectionMock
);
...
...
tests/Events/OracleSessionInitTest.php
View file @
300a8e59
...
...
@@ -14,9 +14,9 @@ class OracleSessionInitTest extends TestCase
public
function
testPostConnect
()
:
void
{
$connectionMock
=
$this
->
createMock
(
Connection
::
class
);
$connectionMock
->
expects
(
$this
->
once
())
$connectionMock
->
expects
(
self
::
once
())
->
method
(
'executeUpdate'
)
->
with
(
$this
->
isType
(
'string'
));
->
with
(
self
::
isType
(
'string'
));
$eventArgs
=
new
ConnectionEventArgs
(
$connectionMock
);
...
...
@@ -33,9 +33,9 @@ class OracleSessionInitTest extends TestCase
$connectionMock
=
$this
->
getMockBuilder
(
Connection
::
class
)
->
disableOriginalConstructor
()
->
getMock
();
$connectionMock
->
expects
(
$this
->
once
())
$connectionMock
->
expects
(
self
::
once
())
->
method
(
'executeUpdate'
)
->
with
(
$this
->
stringContains
(
sprintf
(
'%s = %s'
,
$name
,
$value
)));
->
with
(
self
::
stringContains
(
sprintf
(
'%s = %s'
,
$name
,
$value
)));
$eventArgs
=
new
ConnectionEventArgs
(
$connectionMock
);
...
...
tests/Events/SQLSessionInitTest.php
View file @
300a8e59
...
...
@@ -16,9 +16,9 @@ class SQLSessionInitTest extends TestCase
public
function
testPostConnect
()
:
void
{
$connectionMock
=
$this
->
createMock
(
Connection
::
class
);
$connectionMock
->
expects
(
$this
->
once
())
$connectionMock
->
expects
(
self
::
once
())
->
method
(
'exec'
)
->
with
(
$this
->
equalTo
(
"SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"
));
->
with
(
self
::
equalTo
(
"SET SEARCH_PATH TO foo, public, TIMEZONE TO 'Europe/Berlin'"
));
$eventArgs
=
new
ConnectionEventArgs
(
$connectionMock
);
...
...
tests/Functional/BlobTest.php
View file @
300a8e59
...
...
@@ -25,7 +25,7 @@ class BlobTest extends FunctionalTestCase
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this
->
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
}
$table
=
new
Table
(
'blob_table'
);
...
...
@@ -57,7 +57,7 @@ class BlobTest extends FunctionalTestCase
{
// https://github.com/doctrine/dbal/issues/3290
if
(
$this
->
connection
->
getDriver
()
instanceof
OCI8Driver
)
{
$this
->
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
self
::
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
}
$longBlob
=
str_repeat
(
'x'
,
4
*
8192
);
// send 4 chunks
...
...
@@ -113,7 +113,7 @@ class BlobTest extends FunctionalTestCase
{
// https://github.com/doctrine/dbal/issues/3290
if
(
$this
->
connection
->
getDriver
()
instanceof
OCI8Driver
)
{
$this
->
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
self
::
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
}
$this
->
connection
->
insert
(
'blob_table'
,
[
...
...
@@ -140,7 +140,7 @@ class BlobTest extends FunctionalTestCase
public
function
testBindParamProcessesStream
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
OCI8Driver
)
{
$this
->
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
self
::
markTestIncomplete
(
'The oci8 driver does not support stream resources as parameters'
);
}
$stmt
=
$this
->
connection
->
prepare
(
"INSERT INTO blob_table(id, clobfield, blobfield) VALUES (1, 'ignored', ?)"
);
...
...
tests/Functional/ConnectionTest.php
View file @
300a8e59
...
...
@@ -74,7 +74,7 @@ class ConnectionTest extends FunctionalTestCase
self
::
assertTrue
(
$this
->
connection
->
isRollbackOnly
());
$this
->
connection
->
commit
();
// should throw exception
$this
->
fail
(
'Transaction commit after failed nested transaction should fail.'
);
self
::
fail
(
'Transaction commit after failed nested transaction should fail.'
);
}
catch
(
ConnectionException
$e
)
{
self
::
assertEquals
(
1
,
$this
->
connection
->
getTransactionNestingLevel
());
$this
->
connection
->
rollBack
();
...
...
@@ -119,7 +119,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testTransactionNestingBehaviorWithSavepoints
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform to support savepoints.'
);
}
$this
->
connection
->
setNestTransactionsWithSavepoints
(
true
);
...
...
@@ -144,21 +144,20 @@ class ConnectionTest extends FunctionalTestCase
self
::
assertFalse
(
$this
->
connection
->
isRollbackOnly
());
try
{
$this
->
connection
->
setNestTransactionsWithSavepoints
(
false
);
$this
->
fail
(
'Should not be able to disable savepoints in usage for nested transactions inside an open transaction.'
);
self
::
fail
(
'Should not be able to disable savepoints in usage for nested transactions inside an open transaction.'
);
}
catch
(
ConnectionException
$e
)
{
self
::
assertTrue
(
$this
->
connection
->
getNestTransactionsWithSavepoints
());
}
$this
->
connection
->
commit
();
// should not throw exception
}
catch
(
ConnectionException
$e
)
{
$this
->
fail
(
'Transaction commit after failed nested transaction should not fail when using savepoints.'
);
$this
->
connection
->
rollBack
();
self
::
fail
(
'Transaction commit after failed nested transaction should not fail when using savepoints.'
);
}
}
public
function
testTransactionNestingBehaviorCantBeChangedInActiveTransaction
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform to support savepoints.'
);
}
$this
->
connection
->
beginTransaction
();
...
...
@@ -169,7 +168,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testSetNestedTransactionsThroughSavepointsNotSupportedThrowsException
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
}
$this
->
expectException
(
ConnectionException
::
class
);
...
...
@@ -181,7 +180,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testCreateSavepointsNotSupportedThrowsException
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
}
$this
->
expectException
(
ConnectionException
::
class
);
...
...
@@ -193,7 +192,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testReleaseSavepointsNotSupportedThrowsException
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
}
$this
->
expectException
(
ConnectionException
::
class
);
...
...
@@ -205,7 +204,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testRollbackSavepointsNotSupportedThrowsException
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
supportsSavepoints
())
{
$this
->
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
self
::
markTestSkipped
(
'This test requires the platform not to support savepoints.'
);
}
$this
->
expectException
(
ConnectionException
::
class
);
...
...
@@ -252,7 +251,7 @@ class ConnectionTest extends FunctionalTestCase
$conn
->
executeQuery
(
$conn
->
getDatabasePlatform
()
->
getDummySelectSQL
());
throw
new
RuntimeException
(
'Ooops!'
);
});
$this
->
fail
(
'Expected exception'
);
self
::
fail
(
'Expected exception'
);
}
catch
(
RuntimeException
$expected
)
{
self
::
assertEquals
(
0
,
$this
->
connection
->
getTransactionNestingLevel
());
}
...
...
@@ -266,7 +265,7 @@ class ConnectionTest extends FunctionalTestCase
$conn
->
executeQuery
(
$conn
->
getDatabasePlatform
()
->
getDummySelectSQL
());
throw
new
Error
(
'Ooops!'
);
});
$this
->
fail
(
'Expected exception'
);
self
::
fail
(
'Expected exception'
);
}
catch
(
Error
$expected
)
{
self
::
assertEquals
(
0
,
$this
->
connection
->
getTransactionNestingLevel
());
}
...
...
@@ -314,7 +313,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testConnectWithoutExplicitDatabaseName
()
:
void
{
if
(
in_array
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
(),
[
'oracle'
,
'db2'
],
true
))
{
$this
->
markTestSkipped
(
'Platform does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Platform does not support connecting without database name.'
);
}
$params
=
$this
->
connection
->
getParams
();
...
...
@@ -337,7 +336,7 @@ class ConnectionTest extends FunctionalTestCase
public
function
testDeterminesDatabasePlatformWhenConnectingToNonExistentDatabase
()
:
void
{
if
(
in_array
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
(),
[
'oracle'
,
'db2'
],
true
))
{
$this
->
markTestSkipped
(
'Platform does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Platform does not support connecting without database name.'
);
}
$params
=
$this
->
connection
->
getParams
();
...
...
tests/Functional/DataAccessTest.php
View file @
300a8e59
...
...
@@ -248,7 +248,7 @@ class DataAccessTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDriver
()
instanceof
MySQLiDriver
||
$this
->
connection
->
getDriver
()
instanceof
SQLSrvDriver
)
{
$this
->
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
self
::
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
}
$datetimeString
=
'2010-01-01 10:10:10'
;
...
...
@@ -319,7 +319,7 @@ class DataAccessTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDriver
()
instanceof
MySQLiDriver
||
$this
->
connection
->
getDriver
()
instanceof
SQLSrvDriver
)
{
$this
->
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
self
::
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
}
$datetimeString
=
'2010-01-01 10:10:10'
;
...
...
@@ -364,7 +364,7 @@ class DataAccessTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDriver
()
instanceof
MySQLiDriver
||
$this
->
connection
->
getDriver
()
instanceof
SQLSrvDriver
)
{
$this
->
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
self
::
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
}
$datetimeString
=
'2010-01-01 10:10:10'
;
...
...
@@ -411,7 +411,7 @@ class DataAccessTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDriver
()
instanceof
MySQLiDriver
||
$this
->
connection
->
getDriver
()
instanceof
SQLSrvDriver
)
{
$this
->
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
self
::
markTestSkipped
(
'mysqli and sqlsrv actually supports this'
);
}
$datetimeString
=
'2010-01-01 10:10:10'
;
...
...
@@ -620,7 +620,7 @@ class DataAccessTest extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
!
$platform
instanceof
SqlitePlatform
)
{
$this
->
markTestSkipped
(
'test is for sqlite only'
);
self
::
markTestSkipped
(
'test is for sqlite only'
);
}
$table
=
new
Table
(
'fetch_table_date_math'
);
...
...
@@ -639,7 +639,7 @@ class DataAccessTest extends FunctionalTestCase
$rowCount
=
$this
->
connection
->
fetchColumn
(
$sql
,
[],
0
);
$this
->
assertEquals
(
1
,
$rowCount
);
self
::
assertEquals
(
1
,
$rowCount
);
}
public
function
testLocateExpression
()
:
void
...
...
@@ -942,11 +942,11 @@ class DataAccessTest extends FunctionalTestCase
$driver
=
$this
->
connection
->
getDriver
();
if
(
$driver
instanceof
Oci8Driver
)
{
$this
->
markTestSkipped
(
'Not supported by OCI8'
);
self
::
markTestSkipped
(
'Not supported by OCI8'
);
}
if
(
$driver
instanceof
MySQLiDriver
)
{
$this
->
markTestSkipped
(
'Mysqli driver dont support this feature.'
);
self
::
markTestSkipped
(
'Mysqli driver dont support this feature.'
);
}
if
(
!
$driver
instanceof
PDOOracleDriver
)
{
...
...
tests/Functional/Driver/IBMDB2/DB2DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DB2DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'ibm_db2'
))
{
$this
->
markTestSkipped
(
'ibm_db2 is not installed.'
);
self
::
markTestSkipped
(
'ibm_db2 is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DB2DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'ibm_db2 only test.'
);
self
::
markTestSkipped
(
'ibm_db2 only test.'
);
}
/**
...
...
@@ -29,7 +29,7 @@ class DB2DriverTest extends AbstractDriverTest
*/
public
function
testConnectsWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'IBM DB2 does not support connecting without database name.'
);
self
::
markTestSkipped
(
'IBM DB2 does not support connecting without database name.'
);
}
/**
...
...
@@ -37,7 +37,7 @@ class DB2DriverTest extends AbstractDriverTest
*/
public
function
testReturnsDatabaseNameWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'IBM DB2 does not support connecting without database name.'
);
self
::
markTestSkipped
(
'IBM DB2 does not support connecting without database name.'
);
}
/**
...
...
tests/Functional/Driver/IBMDB2/DB2StatementTest.php
View file @
300a8e59
...
...
@@ -13,7 +13,7 @@ class DB2StatementTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'ibm_db2'
))
{
$this
->
markTestSkipped
(
'ibm_db2 is not installed.'
);
self
::
markTestSkipped
(
'ibm_db2 is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -22,7 +22,7 @@ class DB2StatementTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'ibm_db2 only test.'
);
self
::
markTestSkipped
(
'ibm_db2 only test.'
);
}
public
function
testExecutionErrorsAreNotSuppressed
()
:
void
...
...
tests/Functional/Driver/Mysqli/ConnectionTest.php
View file @
300a8e59
...
...
@@ -14,7 +14,7 @@ class ConnectionTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'mysqli'
))
{
$this
->
markTestSkipped
(
'mysqli is not installed.'
);
self
::
markTestSkipped
(
'mysqli is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -23,7 +23,7 @@ class ConnectionTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'MySQLi only test.'
);
self
::
markTestSkipped
(
'MySQLi only test.'
);
}
protected
function
tearDown
()
:
void
...
...
tests/Functional/Driver/Mysqli/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'mysqli'
))
{
$this
->
markTestSkipped
(
'mysqli is not installed.'
);
self
::
markTestSkipped
(
'mysqli is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'MySQLi only test.'
);
self
::
markTestSkipped
(
'MySQLi only test.'
);
}
/**
...
...
tests/Functional/Driver/OCI8/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'oci8'
))
{
$this
->
markTestSkipped
(
'oci8 is not installed.'
);
self
::
markTestSkipped
(
'oci8 is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'oci8 only test.'
);
self
::
markTestSkipped
(
'oci8 only test.'
);
}
/**
...
...
@@ -29,7 +29,7 @@ class DriverTest extends AbstractDriverTest
*/
public
function
testConnectsWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
}
/**
...
...
@@ -37,7 +37,7 @@ class DriverTest extends AbstractDriverTest
*/
public
function
testReturnsDatabaseNameWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
}
/**
...
...
tests/Functional/Driver/OCI8/OCI8ConnectionTest.php
View file @
300a8e59
...
...
@@ -16,13 +16,13 @@ class OCI8ConnectionTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'oci8'
))
{
$this
->
markTestSkipped
(
'oci8 is not installed.'
);
self
::
markTestSkipped
(
'oci8 is not installed.'
);
}
parent
::
setUp
();
if
(
!
$this
->
connection
->
getDriver
()
instanceof
Driver
)
{
$this
->
markTestSkipped
(
'oci8 only test.'
);
self
::
markTestSkipped
(
'oci8 only test.'
);
}
$this
->
driverConnection
=
$this
->
connection
->
getWrappedConnection
();
...
...
tests/Functional/Driver/OCI8/StatementTest.php
View file @
300a8e59
...
...
@@ -11,7 +11,7 @@ class StatementTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'oci8'
))
{
$this
->
markTestSkipped
(
'oci8 is not installed.'
);
self
::
markTestSkipped
(
'oci8 is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -20,7 +20,7 @@ class StatementTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'oci8 only test.'
);
self
::
markTestSkipped
(
'oci8 only test.'
);
}
/**
...
...
tests/Functional/Driver/PDOConnectionTest.php
View file @
300a8e59
...
...
@@ -34,7 +34,7 @@ class PDOConnectionTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'PDO connection only test.'
);
self
::
markTestSkipped
(
'PDO connection only test.'
);
}
protected
function
tearDown
()
:
void
...
...
@@ -71,7 +71,7 @@ class PDOConnectionTest extends FunctionalTestCase
$driver
=
$this
->
connection
->
getDriver
();
if
(
$driver
instanceof
PDOSQLSRVDriver
)
{
$this
->
markTestSkipped
(
'pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.'
);
self
::
markTestSkipped
(
'pdo_sqlsrv does not allow setting PDO::ATTR_EMULATE_PREPARES at connection level.'
);
}
// Some PDO adapters do not check the query server-side
...
...
tests/Functional/Driver/PDOMySql/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'pdo_mysql'
))
{
$this
->
markTestSkipped
(
'pdo_mysql is not installed.'
);
self
::
markTestSkipped
(
'pdo_mysql is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'pdo_mysql only test.'
);
self
::
markTestSkipped
(
'pdo_mysql only test.'
);
}
/**
...
...
tests/Functional/Driver/PDOOracle/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'PDO_OCI'
))
{
$this
->
markTestSkipped
(
'PDO_OCI is not installed.'
);
self
::
markTestSkipped
(
'PDO_OCI is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'PDO_OCI only test.'
);
self
::
markTestSkipped
(
'PDO_OCI only test.'
);
}
/**
...
...
@@ -29,7 +29,7 @@ class DriverTest extends AbstractDriverTest
*/
public
function
testConnectsWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
}
/**
...
...
@@ -37,7 +37,7 @@ class DriverTest extends AbstractDriverTest
*/
public
function
testReturnsDatabaseNameWithoutDatabaseNameParameter
()
:
void
{
$this
->
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
self
::
markTestSkipped
(
'Oracle does not support connecting without database name.'
);
}
/**
...
...
tests/Functional/Driver/PDOPgSql/DriverTest.php
View file @
300a8e59
...
...
@@ -17,7 +17,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'pdo_pgsql'
))
{
$this
->
markTestSkipped
(
'pdo_pgsql is not installed.'
);
self
::
markTestSkipped
(
'pdo_pgsql is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -26,7 +26,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'pdo_pgsql only test.'
);
self
::
markTestSkipped
(
'pdo_pgsql only test.'
);
}
/**
...
...
@@ -98,7 +98,7 @@ class DriverTest extends AbstractDriverTest
}
}
$this
->
fail
(
sprintf
(
'Query result does not contain a record where column "query" equals "%s".'
,
$sql
));
self
::
fail
(
sprintf
(
'Query result does not contain a record where column "query" equals "%s".'
,
$sql
));
}
/**
...
...
tests/Functional/Driver/PDOPgsqlConnectionTest.php
View file @
300a8e59
...
...
@@ -13,7 +13,7 @@ class PDOPgsqlConnectionTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'pdo_pgsql'
))
{
$this
->
markTestSkipped
(
'pdo_pgsql is not loaded.'
);
self
::
markTestSkipped
(
'pdo_pgsql is not loaded.'
);
}
parent
::
setUp
();
...
...
@@ -22,7 +22,7 @@ class PDOPgsqlConnectionTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'PDOPgsql only test.'
);
self
::
markTestSkipped
(
'PDOPgsql only test.'
);
}
/**
...
...
tests/Functional/Driver/PDOSqlite/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'pdo_sqlite'
))
{
$this
->
markTestSkipped
(
'pdo_sqlite is not installed.'
);
self
::
markTestSkipped
(
'pdo_sqlite is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'pdo_sqlite only test.'
);
self
::
markTestSkipped
(
'pdo_sqlite only test.'
);
}
/**
...
...
tests/Functional/Driver/PDOSqlsrv/DriverTest.php
View file @
300a8e59
...
...
@@ -16,7 +16,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'pdo_sqlsrv'
))
{
$this
->
markTestSkipped
(
'pdo_sqlsrv is not installed.'
);
self
::
markTestSkipped
(
'pdo_sqlsrv is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -25,7 +25,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'pdo_sqlsrv only test.'
);
self
::
markTestSkipped
(
'pdo_sqlsrv only test.'
);
}
/**
...
...
tests/Functional/Driver/SQLAnywhere/ConnectionTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class ConnectionTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'sqlanywhere'
))
{
$this
->
markTestSkipped
(
'sqlanywhere is not installed.'
);
self
::
markTestSkipped
(
'sqlanywhere is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class ConnectionTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'sqlanywhere only test.'
);
self
::
markTestSkipped
(
'sqlanywhere only test.'
);
}
public
function
testNonPersistentConnection
()
:
void
...
...
tests/Functional/Driver/SQLAnywhere/DriverTest.php
View file @
300a8e59
...
...
@@ -13,7 +13,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'sqlanywhere'
))
{
$this
->
markTestSkipped
(
'sqlanywhere is not installed.'
);
self
::
markTestSkipped
(
'sqlanywhere is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -22,7 +22,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'sqlanywhere only test.'
);
self
::
markTestSkipped
(
'sqlanywhere only test.'
);
}
public
function
testReturnsDatabaseNameWithoutDatabaseNameParameter
()
:
void
...
...
tests/Functional/Driver/SQLAnywhere/StatementTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class StatementTest extends FunctionalTestCase
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'sqlanywhere'
))
{
$this
->
markTestSkipped
(
'sqlanywhere is not installed.'
);
self
::
markTestSkipped
(
'sqlanywhere is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class StatementTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'sqlanywhere only test.'
);
self
::
markTestSkipped
(
'sqlanywhere only test.'
);
}
public
function
testNonPersistentStatement
()
:
void
...
...
tests/Functional/Driver/SQLSrv/DriverTest.php
View file @
300a8e59
...
...
@@ -12,7 +12,7 @@ class DriverTest extends AbstractDriverTest
protected
function
setUp
()
:
void
{
if
(
!
extension_loaded
(
'sqlsrv'
))
{
$this
->
markTestSkipped
(
'sqlsrv is not installed.'
);
self
::
markTestSkipped
(
'sqlsrv is not installed.'
);
}
parent
::
setUp
();
...
...
@@ -21,7 +21,7 @@ class DriverTest extends AbstractDriverTest
return
;
}
$this
->
markTestSkipped
(
'sqlsrv only test.'
);
self
::
markTestSkipped
(
'sqlsrv only test.'
);
}
/**
...
...
tests/Functional/ExceptionTest.php
View file @
300a8e59
...
...
@@ -37,7 +37,7 @@ class ExceptionTest extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'Driver does not support special exception handling.'
);
self
::
markTestSkipped
(
'Driver does not support special exception handling.'
);
}
public
function
testPrimaryConstraintViolationException
()
:
void
...
...
@@ -296,7 +296,7 @@ class ExceptionTest extends FunctionalTestCase
public
function
testConnectionExceptionSqLite
()
:
void
{
if
(
!
(
$this
->
connection
->
getDatabasePlatform
()
instanceof
SqlitePlatform
))
{
$this
->
markTestSkipped
(
'Only fails this way on sqlite'
);
self
::
markTestSkipped
(
'Only fails this way on sqlite'
);
}
// mode 0 is considered read-only on Windows
...
...
@@ -353,11 +353,11 @@ EOT
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
$platform
instanceof
SqlitePlatform
)
{
$this
->
markTestSkipped
(
'Only skipped if platform is not sqlite'
);
self
::
markTestSkipped
(
'Only skipped if platform is not sqlite'
);
}
if
(
$platform
instanceof
PostgreSQL94Platform
&&
isset
(
$params
[
'password'
]))
{
$this
->
markTestSkipped
(
'Does not work on Travis'
);
self
::
markTestSkipped
(
'Does not work on Travis'
);
}
if
(
$platform
instanceof
MySqlPlatform
&&
isset
(
$params
[
'user'
]))
{
...
...
@@ -365,7 +365,7 @@ EOT
assert
(
$wrappedConnection
instanceof
ServerInfoAwareConnection
);
if
(
version_compare
(
$wrappedConnection
->
getServerVersion
(),
'8'
,
'>='
))
{
$this
->
markTestIncomplete
(
'PHP currently does not completely support MySQL 8'
);
self
::
markTestIncomplete
(
'PHP currently does not completely support MySQL 8'
);
}
}
...
...
tests/Functional/LikeWildcardsEscapingTest.php
View file @
300a8e59
...
...
@@ -23,6 +23,6 @@ final class LikeWildcardsEscapingTest extends FunctionalTestCase
)
);
$stmt
->
execute
();
$this
->
assertTrue
((
bool
)
$stmt
->
fetchColumn
());
self
::
assertTrue
((
bool
)
$stmt
->
fetchColumn
());
}
}
tests/Functional/LoggingTest.php
View file @
300a8e59
...
...
@@ -12,10 +12,10 @@ class LoggingTest extends FunctionalTestCase
$sql
=
$this
->
connection
->
getDatabasePlatform
()
->
getDummySelectSQL
();
$logMock
=
$this
->
createMock
(
SQLLogger
::
class
);
$logMock
->
expects
(
$this
->
at
(
0
))
$logMock
->
expects
(
self
::
at
(
0
))
->
method
(
'startQuery'
)
->
with
(
$this
->
equalTo
(
$sql
),
$this
->
equalTo
([]),
$this
->
equalTo
([]));
$logMock
->
expects
(
$this
->
at
(
1
))
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
([]),
self
::
equalTo
([]));
$logMock
->
expects
(
self
::
at
(
1
))
->
method
(
'stopQuery'
);
$this
->
connection
->
getConfiguration
()
->
setSQLLogger
(
$logMock
);
$this
->
connection
->
executeQuery
(
$sql
,
[]);
...
...
@@ -28,10 +28,10 @@ class LoggingTest extends FunctionalTestCase
$sql
=
$this
->
connection
->
getDatabasePlatform
()
->
getDummySelectSQL
();
$logMock
=
$this
->
createMock
(
SQLLogger
::
class
);
$logMock
->
expects
(
$this
->
at
(
0
))
$logMock
->
expects
(
self
::
at
(
0
))
->
method
(
'startQuery'
)
->
with
(
$this
->
equalTo
(
$sql
),
$this
->
equalTo
([]),
$this
->
equalTo
([]));
$logMock
->
expects
(
$this
->
at
(
1
))
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
([]),
self
::
equalTo
([]));
$logMock
->
expects
(
self
::
at
(
1
))
->
method
(
'stopQuery'
);
$this
->
connection
->
getConfiguration
()
->
setSQLLogger
(
$logMock
);
$this
->
connection
->
executeUpdate
(
$sql
,
[]);
...
...
@@ -42,10 +42,10 @@ class LoggingTest extends FunctionalTestCase
$sql
=
$this
->
connection
->
getDatabasePlatform
()
->
getDummySelectSQL
();
$logMock
=
$this
->
createMock
(
SQLLogger
::
class
);
$logMock
->
expects
(
$this
->
once
())
$logMock
->
expects
(
self
::
once
())
->
method
(
'startQuery'
)
->
with
(
$this
->
equalTo
(
$sql
),
$this
->
equalTo
([]));
$logMock
->
expects
(
$this
->
at
(
1
))
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
([]));
$logMock
->
expects
(
self
::
at
(
1
))
->
method
(
'stopQuery'
);
$this
->
connection
->
getConfiguration
()
->
setSQLLogger
(
$logMock
);
...
...
tests/Functional/MasterSlaveConnectionTest.php
View file @
300a8e59
...
...
@@ -28,7 +28,7 @@ class MasterSlaveConnectionTest extends FunctionalTestCase
// This is a MySQL specific test, skip other vendors.
if
(
$platformName
!==
'mysql'
)
{
$this
->
markTestSkipped
(
sprintf
(
'Test does not work on %s.'
,
$platformName
));
self
::
markTestSkipped
(
sprintf
(
'Test does not work on %s.'
,
$platformName
));
}
try
{
...
...
tests/Functional/NamedParametersTest.php
View file @
300a8e59
...
...
@@ -199,7 +199,7 @@ class NamedParametersTest extends FunctionalTestCase
'bar'
=>
2
,
]);
}
catch
(
Throwable
$e
)
{
$this
->
fail
(
$e
->
getMessage
());
self
::
fail
(
$e
->
getMessage
());
}
}
...
...
tests/Functional/Platform/NewPrimaryKeyWithNewAutoIncrementColumnTest.php
View file @
300a8e59
...
...
@@ -20,7 +20,7 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
return
;
}
$this
->
markTestSkipped
(
'Restricted to MySQL.'
);
self
::
markTestSkipped
(
'Restricted to MySQL.'
);
}
/**
...
...
@@ -57,10 +57,10 @@ final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCa
$validationSchema
=
$schemaManager
->
createSchema
();
$validationTable
=
$validationSchema
->
getTable
(
$table
->
getName
());
$this
->
assertTrue
(
$validationTable
->
hasColumn
(
'new_id'
));
$this
->
assertTrue
(
$validationTable
->
getColumn
(
'new_id'
)
->
getAutoincrement
());
$this
->
assertTrue
(
$validationTable
->
hasPrimaryKey
());
$this
->
assertSame
([
'new_id'
],
$validationTable
->
getPrimaryKeyColumns
());
self
::
assertTrue
(
$validationTable
->
hasColumn
(
'new_id'
));
self
::
assertTrue
(
$validationTable
->
getColumn
(
'new_id'
)
->
getAutoincrement
());
self
::
assertTrue
(
$validationTable
->
hasPrimaryKey
());
self
::
assertSame
([
'new_id'
],
$validationTable
->
getPrimaryKeyColumns
());
}
private
function
getPlatform
()
:
AbstractPlatform
...
...
tests/Functional/Schema/MySqlSchemaManagerTest.php
View file @
300a8e59
...
...
@@ -178,7 +178,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes
()
:
void
{
if
(
$this
->
schemaManager
->
getDatabasePlatform
()
instanceof
MariaDb1027Platform
)
{
$this
->
markTestSkipped
(
self
::
markTestSkipped
(
'MariaDb102Platform supports default values for BLOB and TEXT columns and will propagate values'
);
}
...
...
@@ -489,7 +489,7 @@ class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testColumnDefaultValuesCurrentTimeAndDate
()
:
void
{
if
(
!
$this
->
schemaManager
->
getDatabasePlatform
()
instanceof
MariaDb1027Platform
)
{
$this
->
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
self
::
markTestSkipped
(
'Only relevant for MariaDb102Platform.'
);
}
$platform
=
$this
->
schemaManager
->
getDatabasePlatform
();
...
...
tests/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
300a8e59
...
...
@@ -224,7 +224,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public
function
testListForeignKeys
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsForeignKeyConstraints
())
{
$this
->
markTestSkipped
(
'Does not support foreign key constraints.'
);
self
::
markTestSkipped
(
'Does not support foreign key constraints.'
);
}
$fkOptions
=
[
'SET NULL'
,
'SET DEFAULT'
,
'NO ACTION'
,
'CASCADE'
,
'RESTRICT'
];
...
...
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
300a8e59
This diff is collapsed.
Click to expand it.
tests/Functional/Schema/SqliteSchemaManagerTest.php
View file @
300a8e59
...
...
@@ -162,12 +162,12 @@ EOS
public
function
testNonDefaultPKOrder
()
:
void
{
if
(
!
extension_loaded
(
'sqlite3'
))
{
$this
->
markTestSkipped
(
'This test requires the SQLite3 extension.'
);
self
::
markTestSkipped
(
'This test requires the SQLite3 extension.'
);
}
$version
=
SQLite3
::
version
();
if
(
version_compare
(
$version
[
'versionString'
],
'3.7.16'
,
'<'
))
{
$this
->
markTestSkipped
(
'This version of sqlite doesn\'t return the order of the Primary Key.'
);
self
::
markTestSkipped
(
'This version of sqlite doesn\'t return the order of the Primary Key.'
);
}
$this
->
connection
->
exec
(
<<<EOS
CREATE TABLE non_default_pk_order (
...
...
@@ -276,6 +276,6 @@ SQL;
$lastUsedIdAfterDelete
=
(
int
)
$query
->
fetchColumn
();
// with an empty table, non autoincrement rowid is always 1
$this
->
assertEquals
(
1
,
$lastUsedIdAfterDelete
);
self
::
assertEquals
(
1
,
$lastUsedIdAfterDelete
);
}
}
tests/Functional/StatementTest.php
View file @
300a8e59
...
...
@@ -27,7 +27,7 @@ class StatementTest extends FunctionalTestCase
public
function
testStatementIsReusableAfterClosingCursor
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
$this
->
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
self
::
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
}
$this
->
connection
->
insert
(
'stmt_test'
,
[
'id'
=>
1
]);
...
...
@@ -52,7 +52,7 @@ class StatementTest extends FunctionalTestCase
public
function
testReuseStatementWithLongerResults
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
$this
->
markTestIncomplete
(
'PDO_OCI doesn\'t support fetching blobs via PDOStatement::fetchAll()'
);
self
::
markTestIncomplete
(
'PDO_OCI doesn\'t support fetching blobs via PDOStatement::fetchAll()'
);
}
$sm
=
$this
->
connection
->
getSchemaManager
();
...
...
@@ -91,7 +91,7 @@ class StatementTest extends FunctionalTestCase
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this
->
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
}
// make sure memory limit is large enough to not cause false positives,
...
...
@@ -154,7 +154,7 @@ EOF
public
function
testReuseStatementAfterClosingCursor
()
:
void
{
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
$this
->
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
self
::
markTestIncomplete
(
'See https://bugs.php.net/bug.php?id=77181'
);
}
$this
->
connection
->
insert
(
'stmt_test'
,
[
'id'
=>
1
]);
...
...
tests/Functional/TableGeneratorTest.php
View file @
300a8e59
...
...
@@ -22,7 +22,7 @@ class TableGeneratorTest extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
$platform
->
getName
()
===
'sqlite'
)
{
$this
->
markTestSkipped
(
'TableGenerator does not work with SQLite'
);
self
::
markTestSkipped
(
'TableGenerator does not work with SQLite'
);
}
try
{
...
...
tests/Functional/TemporaryTableTest.php
View file @
300a8e59
...
...
@@ -38,7 +38,7 @@ class TemporaryTableTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
===
'sqlanywhere'
||
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
===
'oracle'
)
{
$this
->
markTestSkipped
(
'Test does not work on Oracle and SQL Anywhere.'
);
self
::
markTestSkipped
(
'Test does not work on Oracle and SQL Anywhere.'
);
}
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
...
@@ -73,7 +73,7 @@ class TemporaryTableTest extends FunctionalTestCase
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
===
'sqlanywhere'
||
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
===
'oracle'
)
{
$this
->
markTestSkipped
(
'Test does not work on Oracle and SQL Anywhere.'
);
self
::
markTestSkipped
(
'Test does not work on Oracle and SQL Anywhere.'
);
}
$platform
=
$this
->
connection
->
getDatabasePlatform
();
...
...
tests/Functional/Ticket/DBAL168Test.php
View file @
300a8e59
...
...
@@ -13,7 +13,7 @@ class DBAL168Test extends FunctionalTestCase
public
function
testDomainsTable
()
:
void
{
if
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
!==
'postgresql'
)
{
$this
->
markTestSkipped
(
'PostgreSQL only test'
);
self
::
markTestSkipped
(
'PostgreSQL only test'
);
}
$table
=
new
Table
(
'domains'
);
...
...
tests/Functional/Ticket/DBAL202Test.php
View file @
300a8e59
...
...
@@ -15,7 +15,7 @@ class DBAL202Test extends FunctionalTestCase
parent
::
setUp
();
if
(
$this
->
connection
->
getDatabasePlatform
()
->
getName
()
!==
'oracle'
)
{
$this
->
markTestSkipped
(
'OCI8 only test'
);
self
::
markTestSkipped
(
'OCI8 only test'
);
}
if
(
$this
->
connection
->
getSchemaManager
()
->
tablesExist
(
'DBAL202'
))
{
...
...
tests/Functional/Ticket/DBAL461Test.php
View file @
300a8e59
...
...
@@ -36,6 +36,6 @@ class DBAL461Test extends TestCase
'comment'
=>
null
,
]);
$this
->
assertInstanceOf
(
DecimalType
::
class
,
$column
->
getType
());
self
::
assertInstanceOf
(
DecimalType
::
class
,
$column
->
getType
());
}
}
tests/Functional/Ticket/DBAL510Test.php
View file @
300a8e59
...
...
@@ -19,7 +19,7 @@ class DBAL510Test extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'PostgreSQL Only test'
);
self
::
markTestSkipped
(
'PostgreSQL Only test'
);
}
public
function
testSearchPathSchemaChanges
()
:
void
...
...
tests/Functional/Ticket/DBAL630Test.php
View file @
300a8e59
...
...
@@ -23,7 +23,7 @@ class DBAL630Test extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
()
->
getName
();
if
(
!
in_array
(
$platform
,
[
'postgresql'
]))
{
$this
->
markTestSkipped
(
'Currently restricted to PostgreSQL'
);
self
::
markTestSkipped
(
'Currently restricted to PostgreSQL'
);
}
try
{
...
...
tests/Functional/Ticket/DBAL752Test.php
View file @
300a8e59
...
...
@@ -20,7 +20,7 @@ class DBAL752Test extends FunctionalTestCase
return
;
}
$this
->
markTestSkipped
(
'Related to SQLite only'
);
self
::
markTestSkipped
(
'Related to SQLite only'
);
}
public
function
testUnsignedIntegerDetection
()
:
void
...
...
tests/Functional/TransactionTest.php
View file @
300a8e59
...
...
@@ -30,10 +30,10 @@ class TransactionTest extends FunctionalTestCase
{
$this
->
connection
->
query
(
'SET SESSION wait_timeout=1'
);
$this
->
assertTrue
(
$this
->
connection
->
beginTransaction
());
self
::
assertTrue
(
$this
->
connection
->
beginTransaction
());
sleep
(
2
);
// during the sleep mysql will close the connection
$this
->
assertFalse
(
@
$this
->
connection
->
commit
());
// we will ignore `MySQL server has gone away` warnings
self
::
assertFalse
(
@
$this
->
connection
->
commit
());
// we will ignore `MySQL server has gone away` warnings
}
}
tests/Functional/TypeConversionTest.php
View file @
300a8e59
...
...
@@ -122,7 +122,7 @@ class TypeConversionTest extends FunctionalTestCase
if
(
$type
===
'text'
&&
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
// inserting BLOBs as streams on Oracle requires Oracle-specific SQL syntax which is currently not supported
// see http://php.net/manual/en/pdo.lobs.php#example-1035
$this
->
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
self
::
markTestSkipped
(
'DBAL doesn\'t support storing LOBs represented as streams using PDO_OCI'
);
}
$dbValue
=
$this
->
processValue
(
$type
,
$originalValue
);
...
...
tests/Functional/Types/BinaryTest.php
View file @
300a8e59
...
...
@@ -21,7 +21,7 @@ class BinaryTest extends FunctionalTestCase
parent
::
setUp
();
if
(
$this
->
connection
->
getDriver
()
instanceof
PDOOracleDriver
)
{
$this
->
markTestSkipped
(
'PDO_OCI doesn\'t support binding binary values'
);
self
::
markTestSkipped
(
'PDO_OCI doesn\'t support binding binary values'
);
}
$table
=
new
Table
(
'binary_table'
);
...
...
@@ -53,8 +53,8 @@ class BinaryTest extends FunctionalTestCase
$this
->
insert
(
$id1
,
$value1
);
$this
->
insert
(
$id2
,
$value2
);
$this
->
assertSame
(
$value1
,
$this
->
select
(
$id1
));
$this
->
assertSame
(
$value2
,
$this
->
select
(
$id2
));
self
::
assertSame
(
$value1
,
$this
->
select
(
$id1
));
self
::
assertSame
(
$value2
,
$this
->
select
(
$id2
));
}
private
function
insert
(
string
$id
,
string
$value
)
:
void
...
...
tests/Functional/WriteTest.php
View file @
300a8e59
...
...
@@ -146,7 +146,7 @@ class WriteTest extends FunctionalTestCase
public
function
testLastInsertId
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
prefersIdentityColumns
())
{
$this
->
markTestSkipped
(
'Test only works on platforms with identity columns.'
);
self
::
markTestSkipped
(
'Test only works on platforms with identity columns.'
);
}
self
::
assertEquals
(
1
,
$this
->
connection
->
insert
(
'write_table'
,
[
'test_int'
=>
2
,
'test_string'
=>
'bar'
]));
...
...
@@ -159,7 +159,7 @@ class WriteTest extends FunctionalTestCase
public
function
testLastInsertIdSequence
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSequences
())
{
$this
->
markTestSkipped
(
'Test only works on platforms with sequences.'
);
self
::
markTestSkipped
(
'Test only works on platforms with sequences.'
);
}
$sequence
=
new
Sequence
(
'write_table_id_seq'
);
...
...
@@ -185,7 +185,7 @@ class WriteTest extends FunctionalTestCase
public
function
testLastInsertIdNoSequenceGiven
()
:
void
{
if
(
!
$this
->
connection
->
getDatabasePlatform
()
->
supportsSequences
()
||
$this
->
connection
->
getDatabasePlatform
()
->
supportsIdentityColumns
())
{
$this
->
markTestSkipped
(
"Test only works consistently on platforms that support sequences and don't support identity columns."
);
self
::
markTestSkipped
(
"Test only works consistently on platforms that support sequences and don't support identity columns."
);
}
self
::
assertFalse
(
$this
->
lastInsertId
());
...
...
@@ -260,7 +260,7 @@ class WriteTest extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
();
if
(
!
(
$platform
->
supportsIdentityColumns
()
||
$platform
->
usesSequenceEmulatedIdentityColumns
()))
{
$this
->
markTestSkipped
(
self
::
markTestSkipped
(
'Test only works on platforms with identity columns or sequence emulated identity columns.'
);
}
...
...
@@ -350,7 +350,7 @@ class WriteTest extends FunctionalTestCase
return
$this
->
connection
->
lastInsertId
(
$name
);
}
catch
(
DriverException
$e
)
{
if
(
$e
->
getCode
()
===
'IM001'
)
{
$this
->
markTestSkipped
(
$e
->
getMessage
());
self
::
markTestSkipped
(
$e
->
getMessage
());
}
throw
$e
;
...
...
tests/Logging/LoggerChainTest.php
View file @
300a8e59
...
...
@@ -47,7 +47,7 @@ class LoggerChainTest extends TestCase
private
function
createLogger
(
string
$method
,
...
$args
)
:
SQLLogger
{
$logger
=
$this
->
createMock
(
SQLLogger
::
class
);
$logger
->
expects
(
$this
->
once
())
$logger
->
expects
(
self
::
once
())
->
method
(
$method
)
->
with
(
...
$args
);
...
...
tests/Platforms/AbstractPlatformTestCase.php
View file @
300a8e59
...
...
@@ -39,7 +39,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public
function
testQuoteIdentifier
()
:
void
{
if
(
$this
->
platform
->
getName
()
===
'mssql'
)
{
$this
->
markTestSkipped
(
'Not working this way on mssql.'
);
self
::
markTestSkipped
(
'Not working this way on mssql.'
);
}
$c
=
$this
->
platform
->
getIdentifierQuoteCharacter
();
...
...
@@ -54,7 +54,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public
function
testQuoteSingleIdentifier
()
:
void
{
if
(
$this
->
platform
->
getName
()
===
'mssql'
)
{
$this
->
markTestSkipped
(
'Not working this way on mssql.'
);
self
::
markTestSkipped
(
'Not working this way on mssql.'
);
}
$c
=
$this
->
platform
->
getIdentifierQuoteCharacter
();
...
...
@@ -379,10 +379,10 @@ abstract class AbstractPlatformTestCase extends TestCase
->
addMethods
([
'onSchemaCreateTable'
,
'onSchemaCreateTableColumn'
])
->
getMock
();
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaCreateTable'
);
$listenerMock
->
expects
(
$this
->
exactly
(
2
))
->
expects
(
self
::
exactly
(
2
))
->
method
(
'onSchemaCreateTableColumn'
);
$eventManager
=
new
EventManager
();
...
...
@@ -403,7 +403,7 @@ abstract class AbstractPlatformTestCase extends TestCase
->
addMethods
([
'onSchemaDropTable'
])
->
getMock
();
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaDropTable'
);
$eventManager
=
new
EventManager
();
...
...
@@ -428,19 +428,19 @@ abstract class AbstractPlatformTestCase extends TestCase
->
addMethods
(
$events
)
->
getMock
();
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaAlterTable'
);
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaAlterTableAddColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaAlterTableRemoveColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaAlterTableChangeColumn'
);
$listenerMock
->
expects
(
$this
->
once
())
->
expects
(
self
::
once
())
->
method
(
'onSchemaAlterTableRenameColumn'
);
$eventManager
=
new
EventManager
();
...
...
@@ -533,7 +533,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public
function
getCreateTableColumnCommentsSQL
()
:
array
{
$this
->
markTestSkipped
(
'Platform does not support Column comments.'
);
self
::
markTestSkipped
(
'Platform does not support Column comments.'
);
}
/**
...
...
@@ -541,7 +541,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public
function
getAlterTableColumnCommentsSQL
()
:
array
{
$this
->
markTestSkipped
(
'Platform does not support Column comments.'
);
self
::
markTestSkipped
(
'Platform does not support Column comments.'
);
}
/**
...
...
@@ -549,7 +549,7 @@ abstract class AbstractPlatformTestCase extends TestCase
*/
public
function
getCreateTableColumnTypeCommentsSQL
()
:
array
{
$this
->
markTestSkipped
(
'Platform does not support Column comments.'
);
self
::
markTestSkipped
(
'Platform does not support Column comments.'
);
}
public
function
testGetDefaultValueDeclarationSQL
()
:
void
...
...
@@ -1119,7 +1119,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public
function
testQuotesDropForeignKeySQL
()
:
void
{
if
(
!
$this
->
platform
->
supportsForeignKeyConstraints
())
{
$this
->
markTestSkipped
(
self
::
markTestSkipped
(
sprintf
(
'%s does not support foreign key constraints.'
,
get_class
(
$this
->
platform
))
);
}
...
...
@@ -1226,7 +1226,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public
function
testGeneratesInlineColumnCommentSQL
(
?
string
$comment
,
string
$expectedSql
)
:
void
{
if
(
!
$this
->
platform
->
supportsInlineColumnComments
())
{
$this
->
markTestSkipped
(
sprintf
(
'%s does not support inline column comments.'
,
get_class
(
$this
->
platform
)));
self
::
markTestSkipped
(
sprintf
(
'%s does not support inline column comments.'
,
get_class
(
$this
->
platform
)));
}
self
::
assertSame
(
$expectedSql
,
$this
->
platform
->
getInlineColumnCommentSQL
(
$comment
));
...
...
@@ -1291,7 +1291,7 @@ abstract class AbstractPlatformTestCase extends TestCase
public
function
testThrowsExceptionOnGeneratingInlineColumnCommentSQLIfUnsupported
()
:
void
{
if
(
$this
->
platform
->
supportsInlineColumnComments
())
{
$this
->
markTestSkipped
(
sprintf
(
'%s supports inline column comments.'
,
get_class
(
$this
->
platform
)));
self
::
markTestSkipped
(
sprintf
(
'%s supports inline column comments.'
,
get_class
(
$this
->
platform
)));
}
$this
->
expectException
(
DBALException
::
class
);
...
...
tests/Platforms/AbstractPostgreSQLPlatformTestCase.php
View file @
300a8e59
...
...
@@ -896,8 +896,8 @@ abstract class AbstractPostgreSQLPlatformTestCase extends AbstractPlatformTestCa
$tableDiff
=
$comparator
->
diffTable
(
$table1
,
$table2
);
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assertSame
(
self
::
assertInstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
self
::
assertSame
(
[
'ALTER TABLE "foo" ALTER "bar" TYPE TIMESTAMP(0) WITHOUT TIME ZONE'
,
'ALTER TABLE "foo" ALTER "bar" DROP DEFAULT'
,
...
...
tests/Platforms/AbstractSQLServerPlatformTestCase.php
View file @
300a8e59
...
...
@@ -1082,7 +1082,7 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
*/
protected
function
getQuotedAlterTableChangeColumnLengthSQL
()
:
array
{
$this
->
markTestIncomplete
(
'Not implemented yet'
);
self
::
markTestIncomplete
(
'Not implemented yet'
);
}
/**
...
...
tests/Platforms/DB2PlatformTest.php
View file @
300a8e59
...
...
@@ -502,7 +502,7 @@ class DB2PlatformTest extends AbstractPlatformTestCase
*/
protected
function
getQuotedAlterTableChangeColumnLengthSQL
()
:
array
{
$this
->
markTestIncomplete
(
'Not implemented yet'
);
self
::
markTestIncomplete
(
'Not implemented yet'
);
}
/**
...
...
tests/Platforms/MariaDb1027PlatformTest.php
View file @
300a8e59
...
...
@@ -45,6 +45,6 @@ class MariaDb1027PlatformTest extends AbstractMySQLPlatformTestCase
*/
public
function
testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes
()
:
void
{
$this
->
markTestSkipped
(
'MariaDB102Platform support propagation of default values for BLOB and TEXT columns'
);
self
::
markTestSkipped
(
'MariaDB102Platform support propagation of default values for BLOB and TEXT columns'
);
}
}
tests/Platforms/OraclePlatformTest.php
View file @
300a8e59
...
...
@@ -632,7 +632,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase
*/
protected
function
getQuotedAlterTableChangeColumnLengthSQL
()
:
array
{
$this
->
markTestIncomplete
(
'Not implemented yet'
);
self
::
markTestIncomplete
(
'Not implemented yet'
);
}
/**
...
...
tests/Platforms/SQLAnywhere16PlatformTest.php
View file @
300a8e59
...
...
@@ -1025,7 +1025,7 @@ class SQLAnywhere16PlatformTest extends AbstractPlatformTestCase
*/
protected
function
getQuotedAlterTableChangeColumnLengthSQL
()
:
array
{
$this
->
markTestIncomplete
(
'Not implemented yet'
);
self
::
markTestIncomplete
(
'Not implemented yet'
);
}
/**
...
...
tests/Platforms/SqlitePlatformTest.php
View file @
300a8e59
...
...
@@ -595,7 +595,7 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
*/
public
function
testAlterTableRenameIndexInSchema
()
:
void
{
$this
->
markTestIncomplete
(
self
::
markTestIncomplete
(
'Test currently produces broken SQL due to SQLLitePlatform::getAlterTable being broken '
.
'when used with schemas.'
);
...
...
@@ -606,7 +606,7 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
*/
public
function
testQuotesAlterTableRenameIndexInSchema
()
:
void
{
$this
->
markTestIncomplete
(
self
::
markTestIncomplete
(
'Test currently produces broken SQL due to SQLLitePlatform::getAlterTable being broken '
.
'when used with schemas.'
);
...
...
tests/Portability/StatementTest.php
View file @
300a8e59
...
...
@@ -43,10 +43,10 @@ class StatementTest extends TestCase
$type
=
ParameterType
::
STRING
;
$length
=
666
;
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'bindParam'
)
->
with
(
$column
,
$variable
,
$type
,
$length
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
self
::
assertTrue
(
$this
->
stmt
->
bindParam
(
$column
,
$variable
,
$type
,
$length
));
}
...
...
@@ -57,19 +57,19 @@ class StatementTest extends TestCase
$value
=
'myvalue'
;
$type
=
ParameterType
::
STRING
;
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'bindValue'
)
->
with
(
$param
,
$value
,
$type
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
self
::
assertTrue
(
$this
->
stmt
->
bindValue
(
$param
,
$value
,
$type
));
}
public
function
testCloseCursor
()
:
void
{
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'closeCursor'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
self
::
assertTrue
(
$this
->
stmt
->
closeCursor
());
}
...
...
@@ -78,9 +78,9 @@ class StatementTest extends TestCase
{
$columnCount
=
666
;
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'columnCount'
)
->
will
(
$this
->
returnValue
(
$columnCount
));
->
will
(
self
::
returnValue
(
$columnCount
));
self
::
assertSame
(
$columnCount
,
$this
->
stmt
->
columnCount
());
}
...
...
@@ -89,9 +89,9 @@ class StatementTest extends TestCase
{
$errorCode
=
'666'
;
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'errorCode'
)
->
will
(
$this
->
returnValue
(
$errorCode
));
->
will
(
self
::
returnValue
(
$errorCode
));
self
::
assertSame
(
$errorCode
,
$this
->
stmt
->
errorCode
());
}
...
...
@@ -100,9 +100,9 @@ class StatementTest extends TestCase
{
$errorInfo
=
[
'666'
,
'Evil error.'
];
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'errorInfo'
)
->
will
(
$this
->
returnValue
(
$errorInfo
));
->
will
(
self
::
returnValue
(
$errorInfo
));
self
::
assertSame
(
$errorInfo
,
$this
->
stmt
->
errorInfo
());
}
...
...
@@ -114,10 +114,10 @@ class StatementTest extends TestCase
'bar'
,
];
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'execute'
)
->
with
(
$params
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
self
::
assertTrue
(
$this
->
stmt
->
execute
(
$params
));
}
...
...
@@ -128,10 +128,10 @@ class StatementTest extends TestCase
$arg1
=
'MyClass'
;
$arg2
=
[
1
,
2
];
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'setFetchMode'
)
->
with
(
$fetchMode
,
$arg1
,
$arg2
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
$re
=
new
ReflectionProperty
(
$this
->
stmt
,
'defaultFetchMode'
);
$re
->
setAccessible
(
true
);
...
...
@@ -143,7 +143,7 @@ class StatementTest extends TestCase
public
function
testGetIterator
()
:
void
{
$this
->
wrappedStmt
->
expects
(
$this
->
exactly
(
3
))
$this
->
wrappedStmt
->
expects
(
self
::
exactly
(
3
))
->
method
(
'fetch'
)
->
willReturnOnConsecutiveCalls
(
'foo'
,
'bar'
,
false
);
...
...
@@ -154,9 +154,9 @@ class StatementTest extends TestCase
{
$rowCount
=
666
;
$this
->
wrappedStmt
->
expects
(
$this
->
once
())
$this
->
wrappedStmt
->
expects
(
self
::
once
())
->
method
(
'rowCount'
)
->
will
(
$this
->
returnValue
(
$rowCount
));
->
will
(
self
::
returnValue
(
$rowCount
));
self
::
assertSame
(
$rowCount
,
$this
->
stmt
->
rowCount
());
}
...
...
tests/Query/Expression/ExpressionBuilderTest.php
View file @
300a8e59
...
...
@@ -21,9 +21,9 @@ class ExpressionBuilderTest extends TestCase
$this
->
expr
=
new
ExpressionBuilder
(
$conn
);
$conn
->
expects
(
$this
->
any
())
$conn
->
expects
(
self
::
any
())
->
method
(
'getExpressionBuilder'
)
->
will
(
$this
->
returnValue
(
$this
->
expr
));
->
will
(
self
::
returnValue
(
$this
->
expr
));
}
/**
...
...
tests/Query/QueryBuilderTest.php
View file @
300a8e59
...
...
@@ -23,9 +23,9 @@ class QueryBuilderTest extends TestCase
$expressionBuilder
=
new
ExpressionBuilder
(
$this
->
conn
);
$this
->
conn
->
expects
(
$this
->
any
())
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'getExpressionBuilder'
)
->
will
(
$this
->
returnValue
(
$expressionBuilder
));
->
will
(
self
::
returnValue
(
$expressionBuilder
));
}
/**
...
...
tests/Schema/ComparatorTest.php
View file @
300a8e59
...
...
@@ -1178,33 +1178,33 @@ class ComparatorTest extends TestCase
->
onlyMethods
([
'getNamespaces'
,
'hasNamespace'
])
->
getMock
();
$fromSchema
->
expects
(
$this
->
once
())
$fromSchema
->
expects
(
self
::
once
())
->
method
(
'getNamespaces'
)
->
will
(
$this
->
returnValue
([
'foo'
,
'bar'
]));
->
will
(
self
::
returnValue
([
'foo'
,
'bar'
]));
$fromSchema
->
expects
(
$this
->
at
(
0
))
$fromSchema
->
expects
(
self
::
at
(
0
))
->
method
(
'hasNamespace'
)
->
with
(
'bar'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
$fromSchema
->
expects
(
$this
->
at
(
1
))
$fromSchema
->
expects
(
self
::
at
(
1
))
->
method
(
'hasNamespace'
)
->
with
(
'baz'
)
->
will
(
$this
->
returnValue
(
false
));
->
will
(
self
::
returnValue
(
false
));
$toSchema
->
expects
(
$this
->
once
())
$toSchema
->
expects
(
self
::
once
())
->
method
(
'getNamespaces'
)
->
will
(
$this
->
returnValue
([
'bar'
,
'baz'
]));
->
will
(
self
::
returnValue
([
'bar'
,
'baz'
]));
$toSchema
->
expects
(
$this
->
at
(
1
))
$toSchema
->
expects
(
self
::
at
(
1
))
->
method
(
'hasNamespace'
)
->
with
(
'foo'
)
->
will
(
$this
->
returnValue
(
false
));
->
will
(
self
::
returnValue
(
false
));
$toSchema
->
expects
(
$this
->
at
(
2
))
$toSchema
->
expects
(
self
::
at
(
2
))
->
method
(
'hasNamespace'
)
->
with
(
'bar'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
$expected
=
new
SchemaDiff
();
$expected
->
fromSchema
=
$fromSchema
;
...
...
tests/Schema/DB2SchemaManagerTest.php
View file @
300a8e59
...
...
@@ -44,7 +44,7 @@ final class DB2SchemaManagerTest extends TestCase
public
function
testListTableNamesFiltersAssetNamesCorrectly
()
:
void
{
$this
->
conn
->
getConfiguration
()
->
setFilterSchemaAssetsExpression
(
'/^(?!T_)/'
);
$this
->
conn
->
expects
(
$this
->
once
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
$this
->
conn
->
expects
(
self
::
once
())
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
([
[
'name'
=>
'FOO'
],
[
'name'
=>
'T_FOO'
],
[
'name'
=>
'BAR'
],
...
...
@@ -67,7 +67,7 @@ final class DB2SchemaManagerTest extends TestCase
{
$filterExpression
=
'/^(?!T_)/'
;
$this
->
conn
->
getConfiguration
()
->
setFilterSchemaAssetsExpression
(
$filterExpression
);
$this
->
conn
->
expects
(
$this
->
once
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
$this
->
conn
->
expects
(
self
::
once
())
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
([
[
'name'
=>
'FOO'
],
[
'name'
=>
'T_FOO'
],
[
'name'
=>
'BAR'
],
...
...
@@ -86,7 +86,7 @@ final class DB2SchemaManagerTest extends TestCase
self
::
assertIsCallable
(
$callable
);
// BC check: Test that regexp expression is still preserved & accessible.
$this
->
assertEquals
(
$filterExpression
,
$this
->
conn
->
getConfiguration
()
->
getFilterSchemaAssetsExpression
());
self
::
assertEquals
(
$filterExpression
,
$this
->
conn
->
getConfiguration
()
->
getFilterSchemaAssetsExpression
());
}
public
function
testListTableNamesFiltersAssetNamesCorrectlyWithCallable
()
:
void
...
...
@@ -95,8 +95,8 @@ final class DB2SchemaManagerTest extends TestCase
$this
->
conn
->
getConfiguration
()
->
setSchemaAssetsFilter
(
static
function
(
$assetName
)
use
(
$accepted
)
{
return
in_array
(
$assetName
,
$accepted
);
});
$this
->
conn
->
expects
(
$this
->
any
())
->
method
(
'quote'
);
$this
->
conn
->
expects
(
$this
->
once
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'quote'
);
$this
->
conn
->
expects
(
self
::
once
())
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
([
[
'name'
=>
'FOO'
],
[
'name'
=>
'T_FOO'
],
[
'name'
=>
'BAR'
],
...
...
@@ -111,7 +111,7 @@ final class DB2SchemaManagerTest extends TestCase
$this
->
manager
->
listTableNames
()
);
$this
->
assertNull
(
$this
->
conn
->
getConfiguration
()
->
getFilterSchemaAssetsExpression
());
self
::
assertNull
(
$this
->
conn
->
getConfiguration
()
->
getFilterSchemaAssetsExpression
());
}
public
function
testSettingNullExpressionWillResetCallable
()
:
void
...
...
@@ -120,8 +120,8 @@ final class DB2SchemaManagerTest extends TestCase
$this
->
conn
->
getConfiguration
()
->
setSchemaAssetsFilter
(
static
function
(
$assetName
)
use
(
$accepted
)
{
return
in_array
(
$assetName
,
$accepted
);
});
$this
->
conn
->
expects
(
$this
->
any
())
->
method
(
'quote'
);
$this
->
conn
->
expects
(
$this
->
atLeastOnce
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'quote'
);
$this
->
conn
->
expects
(
$this
->
atLeastOnce
())
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
([
[
'name'
=>
'FOO'
],
[
'name'
=>
'T_FOO'
],
[
'name'
=>
'BAR'
],
...
...
@@ -148,7 +148,7 @@ final class DB2SchemaManagerTest extends TestCase
$this
->
manager
->
listTableNames
()
);
$this
->
assertNull
(
$this
->
conn
->
getConfiguration
()
->
getSchemaAssetsFilter
());
self
::
assertNull
(
$this
->
conn
->
getConfiguration
()
->
getSchemaAssetsFilter
());
}
public
function
testSettingNullAsCallableClearsExpression
()
:
void
...
...
@@ -156,7 +156,7 @@ final class DB2SchemaManagerTest extends TestCase
$filterExpression
=
'/^(?!T_)/'
;
$this
->
conn
->
getConfiguration
()
->
setFilterSchemaAssetsExpression
(
$filterExpression
);
$this
->
conn
->
expects
(
$this
->
exactly
(
2
))
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
([
$this
->
conn
->
expects
(
self
::
exactly
(
2
))
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
([
[
'name'
=>
'FOO'
],
[
'name'
=>
'T_FOO'
],
[
'name'
=>
'BAR'
],
...
...
tests/Schema/ForeignKeyConstraintTest.php
View file @
300a8e59
...
...
@@ -22,9 +22,9 @@ class ForeignKeyConstraintTest extends TestCase
$index
=
$this
->
getMockBuilder
(
Index
::
class
)
->
disableOriginalConstructor
()
->
getMock
();
$index
->
expects
(
$this
->
once
())
$index
->
expects
(
self
::
once
())
->
method
(
'getColumns'
)
->
will
(
$this
->
returnValue
(
$indexColumns
));
->
will
(
self
::
returnValue
(
$indexColumns
));
self
::
assertSame
(
$expectedResult
,
$foreignKey
->
intersectsIndexColumns
(
$index
));
}
...
...
tests/Schema/MySqlSchemaManagerTest.php
View file @
300a8e59
...
...
@@ -35,7 +35,7 @@ class MySqlSchemaManagerTest extends TestCase
public
function
testCompositeForeignKeys
()
:
void
{
$this
->
conn
->
expects
(
$this
->
once
())
->
method
(
'fetchAll'
)
->
will
(
$this
->
returnValue
(
$this
->
getFKDefinition
()));
$this
->
conn
->
expects
(
self
::
once
())
->
method
(
'fetchAll'
)
->
will
(
self
::
returnValue
(
$this
->
getFKDefinition
()));
$fkeys
=
$this
->
manager
->
listTableForeignKeys
(
'dummy'
);
self
::
assertCount
(
1
,
$fkeys
,
'Table has to have one foreign key.'
);
...
...
tests/Schema/SchemaDiffTest.php
View file @
300a8e59
...
...
@@ -44,60 +44,60 @@ class SchemaDiffTest extends TestCase
{
/** @var AbstractPlatform|MockObject $platform */
$platform
=
$this
->
createMock
(
AbstractPlatform
::
class
);
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateSchemaSQL'
)
->
with
(
'foo_ns'
)
->
will
(
$this
->
returnValue
(
'create_schema'
));
->
will
(
self
::
returnValue
(
'create_schema'
));
if
(
$unsafe
)
{
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getDropSequenceSql'
)
->
with
(
$this
->
isInstanceOf
(
Sequence
::
class
))
->
will
(
$this
->
returnValue
(
'drop_seq'
));
->
with
(
self
::
isInstanceOf
(
Sequence
::
class
))
->
will
(
self
::
returnValue
(
'drop_seq'
));
}
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getAlterSequenceSql'
)
->
with
(
$this
->
isInstanceOf
(
Sequence
::
class
))
->
will
(
$this
->
returnValue
(
'alter_seq'
));
$platform
->
expects
(
$this
->
exactly
(
1
))
->
with
(
self
::
isInstanceOf
(
Sequence
::
class
))
->
will
(
self
::
returnValue
(
'alter_seq'
));
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateSequenceSql'
)
->
with
(
$this
->
isInstanceOf
(
Sequence
::
class
))
->
will
(
$this
->
returnValue
(
'create_seq'
));
->
with
(
self
::
isInstanceOf
(
Sequence
::
class
))
->
will
(
self
::
returnValue
(
'create_seq'
));
if
(
$unsafe
)
{
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getDropTableSql'
)
->
with
(
$this
->
isInstanceOf
(
Table
::
class
))
->
will
(
$this
->
returnValue
(
'drop_table'
));
->
with
(
self
::
isInstanceOf
(
Table
::
class
))
->
will
(
self
::
returnValue
(
'drop_table'
));
}
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateTableSql'
)
->
with
(
$this
->
isInstanceOf
(
Table
::
class
))
->
will
(
$this
->
returnValue
([
'create_table'
]));
$platform
->
expects
(
$this
->
exactly
(
1
))
->
with
(
self
::
isInstanceOf
(
Table
::
class
))
->
will
(
self
::
returnValue
([
'create_table'
]));
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateForeignKeySQL'
)
->
with
(
$this
->
isInstanceOf
(
ForeignKeyConstraint
::
class
))
->
will
(
$this
->
returnValue
(
'create_foreign_key'
));
$platform
->
expects
(
$this
->
exactly
(
1
))
->
with
(
self
::
isInstanceOf
(
ForeignKeyConstraint
::
class
))
->
will
(
self
::
returnValue
(
'create_foreign_key'
));
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getAlterTableSql'
)
->
with
(
$this
->
isInstanceOf
(
TableDiff
::
class
))
->
will
(
$this
->
returnValue
([
'alter_table'
]));
->
with
(
self
::
isInstanceOf
(
TableDiff
::
class
))
->
will
(
self
::
returnValue
([
'alter_table'
]));
if
(
$unsafe
)
{
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getDropForeignKeySql'
)
->
with
(
$this
->
isInstanceOf
(
ForeignKeyConstraint
::
class
),
$this
->
isInstanceOf
(
Table
::
class
)
self
::
isInstanceOf
(
ForeignKeyConstraint
::
class
),
self
::
isInstanceOf
(
Table
::
class
)
)
->
will
(
$this
->
returnValue
(
'drop_orphan_fk'
));
->
will
(
self
::
returnValue
(
'drop_orphan_fk'
));
}
$platform
->
expects
(
$this
->
exactly
(
1
))
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'supportsSchemas'
)
->
will
(
$this
->
returnValue
(
true
));
$platform
->
expects
(
$this
->
exactly
(
1
))
->
will
(
self
::
returnValue
(
true
));
$platform
->
expects
(
self
::
exactly
(
1
))
->
method
(
'supportsSequences'
)
->
will
(
$this
->
returnValue
(
true
));
$platform
->
expects
(
$this
->
exactly
(
2
))
->
will
(
self
::
returnValue
(
true
));
$platform
->
expects
(
self
::
exactly
(
2
))
->
method
(
'supportsForeignKeyConstraints'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
return
$platform
;
}
...
...
tests/Schema/SchemaTest.php
View file @
300a8e59
...
...
@@ -373,30 +373,30 @@ class SchemaTest extends TestCase
$schema
->
createSequence
(
'moo'
);
$schema
->
createSequence
(
'war'
);
$visitor
->
expects
(
$this
->
once
())
$visitor
->
expects
(
self
::
once
())
->
method
(
'acceptSchema'
)
->
with
(
$schema
);
$visitor
->
expects
(
$this
->
at
(
1
))
$visitor
->
expects
(
self
::
at
(
1
))
->
method
(
'acceptTable'
)
->
with
(
$schema
->
getTable
(
'baz'
));
$visitor
->
expects
(
$this
->
at
(
2
))
$visitor
->
expects
(
self
::
at
(
2
))
->
method
(
'acceptTable'
)
->
with
(
$schema
->
getTable
(
'bla.bloo'
));
$visitor
->
expects
(
$this
->
exactly
(
2
))
$visitor
->
expects
(
self
::
exactly
(
2
))
->
method
(
'acceptTable'
);
$visitor
->
expects
(
$this
->
at
(
3
))
$visitor
->
expects
(
self
::
at
(
3
))
->
method
(
'acceptSequence'
)
->
with
(
$schema
->
getSequence
(
'moo'
));
$visitor
->
expects
(
$this
->
at
(
4
))
$visitor
->
expects
(
self
::
at
(
4
))
->
method
(
'acceptSequence'
)
->
with
(
$schema
->
getSequence
(
'war'
));
$visitor
->
expects
(
$this
->
exactly
(
2
))
$visitor
->
expects
(
self
::
exactly
(
2
))
->
method
(
'acceptSequence'
);
self
::
assertNull
(
$schema
->
visit
(
$visitor
));
...
...
@@ -419,45 +419,45 @@ class SchemaTest extends TestCase
$schema
->
createSequence
(
'moo'
);
$schema
->
createSequence
(
'war'
);
$visitor
->
expects
(
$this
->
once
())
$visitor
->
expects
(
self
::
once
())
->
method
(
'acceptSchema'
)
->
with
(
$schema
);
$visitor
->
expects
(
$this
->
at
(
1
))
$visitor
->
expects
(
self
::
at
(
1
))
->
method
(
'acceptNamespace'
)
->
with
(
'foo'
);
$visitor
->
expects
(
$this
->
at
(
2
))
$visitor
->
expects
(
self
::
at
(
2
))
->
method
(
'acceptNamespace'
)
->
with
(
'bar'
);
$visitor
->
expects
(
$this
->
at
(
3
))
$visitor
->
expects
(
self
::
at
(
3
))
->
method
(
'acceptNamespace'
)
->
with
(
'bla'
);
$visitor
->
expects
(
$this
->
exactly
(
3
))
$visitor
->
expects
(
self
::
exactly
(
3
))
->
method
(
'acceptNamespace'
);
$visitor
->
expects
(
$this
->
at
(
4
))
$visitor
->
expects
(
self
::
at
(
4
))
->
method
(
'acceptTable'
)
->
with
(
$schema
->
getTable
(
'baz'
));
$visitor
->
expects
(
$this
->
at
(
5
))
$visitor
->
expects
(
self
::
at
(
5
))
->
method
(
'acceptTable'
)
->
with
(
$schema
->
getTable
(
'bla.bloo'
));
$visitor
->
expects
(
$this
->
exactly
(
2
))
$visitor
->
expects
(
self
::
exactly
(
2
))
->
method
(
'acceptTable'
);
$visitor
->
expects
(
$this
->
at
(
6
))
$visitor
->
expects
(
self
::
at
(
6
))
->
method
(
'acceptSequence'
)
->
with
(
$schema
->
getSequence
(
'moo'
));
$visitor
->
expects
(
$this
->
at
(
7
))
$visitor
->
expects
(
self
::
at
(
7
))
->
method
(
'acceptSequence'
)
->
with
(
$schema
->
getSequence
(
'war'
));
$visitor
->
expects
(
$this
->
exactly
(
2
))
$visitor
->
expects
(
self
::
exactly
(
2
))
->
method
(
'acceptSequence'
);
self
::
assertNull
(
$schema
->
visit
(
$visitor
));
...
...
tests/Schema/TableDiffTest.php
View file @
300a8e59
...
...
@@ -41,10 +41,10 @@ class TableDiffTest extends TestCase
$tableDiff
=
new
TableDiff
(
'foo'
);
$tableDiff
->
fromTable
=
$tableMock
;
$tableMock
->
expects
(
$this
->
once
())
$tableMock
->
expects
(
self
::
once
())
->
method
(
'getQuotedName'
)
->
with
(
$this
->
platform
)
->
will
(
$this
->
returnValue
(
'foo'
));
->
will
(
self
::
returnValue
(
'foo'
));
self
::
assertEquals
(
new
Identifier
(
'foo'
),
$tableDiff
->
getName
(
$this
->
platform
));
}
...
...
tests/Schema/Visitor/CreateSchemaSqlCollectorTest.php
View file @
300a8e59
...
...
@@ -50,13 +50,13 @@ class CreateSchemaSqlCollectorTest extends TestCase
public
function
testAcceptsNamespace
()
:
void
{
$this
->
platformMock
->
expects
(
$this
->
at
(
0
))
$this
->
platformMock
->
expects
(
self
::
at
(
0
))
->
method
(
'supportsSchemas'
)
->
will
(
$this
->
returnValue
(
false
));
->
will
(
self
::
returnValue
(
false
));
$this
->
platformMock
->
expects
(
$this
->
at
(
1
))
$this
->
platformMock
->
expects
(
self
::
at
(
1
))
->
method
(
'supportsSchemas'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
$this
->
visitor
->
acceptNamespace
(
'foo'
);
...
...
@@ -78,13 +78,13 @@ class CreateSchemaSqlCollectorTest extends TestCase
public
function
testAcceptsForeignKey
()
:
void
{
$this
->
platformMock
->
expects
(
$this
->
at
(
0
))
$this
->
platformMock
->
expects
(
self
::
at
(
0
))
->
method
(
'supportsForeignKeyConstraints'
)
->
will
(
$this
->
returnValue
(
false
));
->
will
(
self
::
returnValue
(
false
));
$this
->
platformMock
->
expects
(
$this
->
at
(
1
))
$this
->
platformMock
->
expects
(
self
::
at
(
1
))
->
method
(
'supportsForeignKeyConstraints'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
$table
=
$this
->
createTableMock
();
$foreignKey
=
$this
->
createForeignKeyConstraintMock
();
...
...
@@ -110,9 +110,9 @@ class CreateSchemaSqlCollectorTest extends TestCase
public
function
testResetsQueries
()
:
void
{
foreach
([
'supportsSchemas'
,
'supportsForeignKeyConstraints'
]
as
$method
)
{
$this
->
platformMock
->
expects
(
$this
->
any
())
$this
->
platformMock
->
expects
(
self
::
any
())
->
method
(
$method
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
}
$table
=
$this
->
createTableMock
();
...
...
tests/Schema/Visitor/DropSchemaSqlCollectorTest.php
View file @
300a8e59
...
...
@@ -28,14 +28,14 @@ class DropSchemaSqlCollectorTest extends TestCase
$collector
=
new
DropSchemaSqlCollector
(
$platform
);
$platform
->
expects
(
$this
->
exactly
(
2
))
$platform
->
expects
(
self
::
exactly
(
2
))
->
method
(
'getDropForeignKeySQL'
);
$platform
->
expects
(
$this
->
at
(
0
))
$platform
->
expects
(
self
::
at
(
0
))
->
method
(
'getDropForeignKeySQL'
)
->
with
(
$keyConstraintOne
,
$tableOne
);
$platform
->
expects
(
$this
->
at
(
1
))
$platform
->
expects
(
self
::
at
(
1
))
->
method
(
'getDropForeignKeySQL'
)
->
with
(
$keyConstraintTwo
,
$tableTwo
);
...
...
@@ -49,17 +49,17 @@ class DropSchemaSqlCollectorTest extends TestCase
{
$constraint
=
$this
->
createMock
(
ForeignKeyConstraint
::
class
);
$constraint
->
expects
(
$this
->
any
())
$constraint
->
expects
(
self
::
any
())
->
method
(
'getName'
)
->
will
(
$this
->
returnValue
(
$name
));
->
will
(
self
::
returnValue
(
$name
));
$constraint
->
expects
(
$this
->
any
())
$constraint
->
expects
(
self
::
any
())
->
method
(
'getForeignColumns'
)
->
will
(
$this
->
returnValue
([]));
->
will
(
self
::
returnValue
([]));
$constraint
->
expects
(
$this
->
any
())
$constraint
->
expects
(
self
::
any
())
->
method
(
'getColumns'
)
->
will
(
$this
->
returnValue
([]));
->
will
(
self
::
returnValue
([]));
return
$constraint
;
}
...
...
tests/Schema/Visitor/SchemaSqlCollectorTest.php
View file @
300a8e59
...
...
@@ -13,15 +13,15 @@ class SchemaSqlCollectorTest extends TestCase
$platformMock
=
$this
->
getMockBuilder
(
MySqlPlatform
::
class
)
->
onlyMethods
([
'getCreateTableSql'
,
'getCreateSequenceSql'
,
'getCreateForeignKeySql'
])
->
getMock
();
$platformMock
->
expects
(
$this
->
exactly
(
2
))
$platformMock
->
expects
(
self
::
exactly
(
2
))
->
method
(
'getCreateTableSql'
)
->
will
(
$this
->
returnValue
([
'foo'
]));
$platformMock
->
expects
(
$this
->
exactly
(
1
))
->
will
(
self
::
returnValue
([
'foo'
]));
$platformMock
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateSequenceSql'
)
->
will
(
$this
->
returnValue
(
'bar'
));
$platformMock
->
expects
(
$this
->
exactly
(
1
))
->
will
(
self
::
returnValue
(
'bar'
));
$platformMock
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getCreateForeignKeySql'
)
->
will
(
$this
->
returnValue
(
'baz'
));
->
will
(
self
::
returnValue
(
'baz'
));
$schema
=
$this
->
createFixtureSchema
();
...
...
@@ -35,15 +35,15 @@ class SchemaSqlCollectorTest extends TestCase
$platformMock
=
$this
->
getMockBuilder
(
MySqlPlatform
::
class
)
->
onlyMethods
([
'getDropTableSql'
,
'getDropSequenceSql'
,
'getDropForeignKeySql'
])
->
getMock
();
$platformMock
->
expects
(
$this
->
exactly
(
2
))
$platformMock
->
expects
(
self
::
exactly
(
2
))
->
method
(
'getDropTableSql'
)
->
will
(
$this
->
returnValue
(
'tbl'
));
$platformMock
->
expects
(
$this
->
exactly
(
1
))
->
will
(
self
::
returnValue
(
'tbl'
));
$platformMock
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getDropSequenceSql'
)
->
will
(
$this
->
returnValue
(
'seq'
));
$platformMock
->
expects
(
$this
->
exactly
(
1
))
->
will
(
self
::
returnValue
(
'seq'
));
$platformMock
->
expects
(
self
::
exactly
(
1
))
->
method
(
'getDropForeignKeySql'
)
->
will
(
$this
->
returnValue
(
'fk'
));
->
will
(
self
::
returnValue
(
'fk'
));
$schema
=
$this
->
createFixtureSchema
();
...
...
tests/StatementTest.php
View file @
300a8e59
...
...
@@ -40,18 +40,18 @@ class StatementTest extends TestCase
$this
->
conn
=
$this
->
getMockBuilder
(
Connection
::
class
)
->
setConstructorArgs
([[],
$driver
])
->
getMock
();
$this
->
conn
->
expects
(
$this
->
atLeastOnce
())
$this
->
conn
->
expects
(
self
::
atLeastOnce
())
->
method
(
'getWrappedConnection'
)
->
will
(
$this
->
returnValue
(
$driverConnection
));
->
will
(
self
::
returnValue
(
$driverConnection
));
$this
->
configuration
=
$this
->
createMock
(
Configuration
::
class
);
$this
->
conn
->
expects
(
$this
->
any
())
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'getConfiguration'
)
->
will
(
$this
->
returnValue
(
$this
->
configuration
));
->
will
(
self
::
returnValue
(
$this
->
configuration
));
$this
->
conn
->
expects
(
$this
->
any
())
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'getDriver'
)
->
will
(
$this
->
returnValue
(
$driver
));
->
will
(
self
::
returnValue
(
$driver
));
}
public
function
testExecuteCallsLoggerStartQueryWithParametersWhenValuesBound
()
:
void
...
...
@@ -64,13 +64,13 @@ class StatementTest extends TestCase
$sql
=
''
;
$logger
=
$this
->
createMock
(
SQLLogger
::
class
);
$logger
->
expects
(
$this
->
once
())
$logger
->
expects
(
self
::
once
())
->
method
(
'startQuery'
)
->
with
(
$this
->
equalTo
(
$sql
),
$this
->
equalTo
(
$values
),
$this
->
equalTo
(
$types
));
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
(
$values
),
self
::
equalTo
(
$types
));
$this
->
configuration
->
expects
(
$this
->
once
())
$this
->
configuration
->
expects
(
self
::
once
())
->
method
(
'getSQLLogger'
)
->
will
(
$this
->
returnValue
(
$logger
));
->
will
(
self
::
returnValue
(
$logger
));
$statement
=
new
Statement
(
$sql
,
$this
->
conn
);
$statement
->
bindValue
(
$name
,
$var
,
$type
);
...
...
@@ -86,13 +86,13 @@ class StatementTest extends TestCase
$sql
=
''
;
$logger
=
$this
->
createMock
(
SQLLogger
::
class
);
$logger
->
expects
(
$this
->
once
())
$logger
->
expects
(
self
::
once
())
->
method
(
'startQuery'
)
->
with
(
$this
->
equalTo
(
$sql
),
$this
->
equalTo
(
$values
),
$this
->
equalTo
(
$types
));
->
with
(
self
::
equalTo
(
$sql
),
self
::
equalTo
(
$values
),
self
::
equalTo
(
$types
));
$this
->
configuration
->
expects
(
$this
->
once
())
$this
->
configuration
->
expects
(
self
::
once
())
->
method
(
'getSQLLogger'
)
->
will
(
$this
->
returnValue
(
$logger
));
->
will
(
self
::
returnValue
(
$logger
));
$statement
=
new
Statement
(
$sql
,
$this
->
conn
);
$statement
->
execute
(
$values
);
...
...
@@ -124,24 +124,24 @@ class StatementTest extends TestCase
{
$logger
=
$this
->
createMock
(
SQLLogger
::
class
);
$this
->
configuration
->
expects
(
$this
->
once
())
$this
->
configuration
->
expects
(
self
::
once
())
->
method
(
'getSQLLogger'
)
->
will
(
$this
->
returnValue
(
$logger
));
->
will
(
self
::
returnValue
(
$logger
));
// Needed to satisfy construction of DBALException
$this
->
conn
->
expects
(
$this
->
any
())
$this
->
conn
->
expects
(
self
::
any
())
->
method
(
'resolveParams'
)
->
will
(
$this
->
returnValue
([]));
->
will
(
self
::
returnValue
([]));
$logger
->
expects
(
$this
->
once
())
$logger
->
expects
(
self
::
once
())
->
method
(
'startQuery'
);
$logger
->
expects
(
$this
->
once
())
$logger
->
expects
(
self
::
once
())
->
method
(
'stopQuery'
);
$this
->
driverStatement
->
expects
(
$this
->
once
())
$this
->
driverStatement
->
expects
(
self
::
once
())
->
method
(
'execute'
)
->
will
(
$this
->
throwException
(
new
Exception
(
'Mock test exception'
)));
->
will
(
self
::
throwException
(
new
Exception
(
'Mock test exception'
)));
$statement
=
new
Statement
(
''
,
$this
->
conn
);
...
...
@@ -154,7 +154,7 @@ class StatementTest extends TestCase
{
$statement
=
new
Statement
(
''
,
$this
->
conn
);
$this
->
driverStatement
->
expects
(
$this
->
once
())
$this
->
driverStatement
->
expects
(
self
::
once
())
->
method
(
'fetchAll'
)
->
with
(
self
::
equalTo
(
FetchMode
::
CUSTOM_OBJECT
),
self
::
equalTo
(
'Example'
),
self
::
equalTo
([
'arg1'
]));
...
...
tests/Tools/Console/RunSqlCommandTest.php
View file @
300a8e59
...
...
@@ -46,7 +46,7 @@ class RunSqlCommandTest extends TestCase
'command'
=>
$this
->
command
->
getName
(),
'sql'
=>
null
,
]);
$this
->
fail
(
'Expected a runtime exception when omitting sql argument'
);
self
::
fail
(
'Expected a runtime exception when omitting sql argument'
);
}
catch
(
RuntimeException
$e
)
{
self
::
assertStringContainsString
(
"Argument 'SQL"
,
$e
->
getMessage
());
}
...
...
@@ -60,7 +60,7 @@ class RunSqlCommandTest extends TestCase
'sql'
=>
'SELECT 1'
,
'--depth'
=>
'string'
,
]);
$this
->
fail
(
'Expected a logic exception when executing with a stringy depth'
);
self
::
fail
(
'Expected a logic exception when executing with a stringy depth'
);
}
catch
(
LogicException
$e
)
{
self
::
assertStringContainsString
(
"Option 'depth'"
,
$e
->
getMessage
());
}
...
...
@@ -74,7 +74,7 @@ class RunSqlCommandTest extends TestCase
'command'
=>
$this
->
command
->
getName
(),
'sql'
=>
'SELECT 1'
,
]);
$this
->
assertSame
(
0
,
$exitCode
);
self
::
assertSame
(
0
,
$exitCode
);
self
::
assertRegExp
(
'@int.*1.*@'
,
$this
->
commandTester
->
getDisplay
());
self
::
assertRegExp
(
'@array.*1.*@'
,
$this
->
commandTester
->
getDisplay
());
...
...
@@ -96,20 +96,20 @@ class RunSqlCommandTest extends TestCase
private
function
expectConnectionExecuteUpdate
()
:
void
{
$this
->
connectionMock
->
expects
(
$this
->
exactly
(
1
))
->
expects
(
self
::
exactly
(
1
))
->
method
(
'executeUpdate'
);
$this
->
connectionMock
->
expects
(
$this
->
exactly
(
0
))
->
expects
(
self
::
exactly
(
0
))
->
method
(
'fetchAll'
);
}
private
function
expectConnectionFetchAll
()
:
void
{
$this
->
connectionMock
->
expects
(
$this
->
exactly
(
0
))
->
expects
(
self
::
exactly
(
0
))
->
method
(
'executeUpdate'
);
$this
->
connectionMock
->
expects
(
$this
->
exactly
(
1
))
->
expects
(
self
::
exactly
(
1
))
->
method
(
'fetchAll'
);
}
...
...
tests/Types/BinaryTest.php
View file @
300a8e59
...
...
@@ -43,7 +43,7 @@ class BinaryTest extends TestCase
public
function
testReturnsSQLDeclaration
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getBinaryTypeDeclarationSQL'
)
->
willReturn
(
'TEST_BINARY'
);
...
...
tests/Types/DateImmutableTypeTest.php
View file @
300a8e59
...
...
@@ -46,10 +46,10 @@ class DateImmutableTypeTest extends TestCase
{
$date
=
$this
->
createMock
(
DateTimeImmutable
::
class
);
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateFormatString'
)
->
willReturn
(
'Y-m-d'
);
$date
->
expects
(
$this
->
once
())
$date
->
expects
(
self
::
once
())
->
method
(
'format'
)
->
with
(
'Y-m-d'
)
->
willReturn
(
'2016-01-01'
);
...
...
@@ -86,7 +86,7 @@ class DateImmutableTypeTest extends TestCase
public
function
testConvertsDateStringToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateFormatString'
)
->
willReturn
(
'Y-m-d'
);
...
...
@@ -98,7 +98,7 @@ class DateImmutableTypeTest extends TestCase
public
function
testResetTimeFractionsWhenConvertingToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
any
())
$this
->
platform
->
expects
(
self
::
any
())
->
method
(
'getDateFormatString'
)
->
willReturn
(
'Y-m-d'
);
...
...
tests/Types/DateTimeImmutableTypeTest.php
View file @
300a8e59
...
...
@@ -46,10 +46,10 @@ class DateTimeImmutableTypeTest extends TestCase
{
$date
=
$this
->
getMockBuilder
(
DateTimeImmutable
::
class
)
->
getMock
();
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateTimeFormatString'
)
->
willReturn
(
'Y-m-d H:i:s'
);
$date
->
expects
(
$this
->
once
())
$date
->
expects
(
self
::
once
())
->
method
(
'format'
)
->
with
(
'Y-m-d H:i:s'
)
->
willReturn
(
'2016-01-01 15:58:59'
);
...
...
@@ -86,7 +86,7 @@ class DateTimeImmutableTypeTest extends TestCase
public
function
testConvertsDateTimeStringToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateTimeFormatString'
)
->
willReturn
(
'Y-m-d H:i:s'
);
...
...
@@ -101,7 +101,7 @@ class DateTimeImmutableTypeTest extends TestCase
*/
public
function
testConvertsDateTimeStringWithMicrosecondsToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
any
())
$this
->
platform
->
expects
(
self
::
any
())
->
method
(
'getDateTimeFormatString'
)
->
willReturn
(
'Y-m-d H:i:s'
);
...
...
@@ -112,7 +112,7 @@ class DateTimeImmutableTypeTest extends TestCase
public
function
testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTimeString
()
:
void
{
$this
->
platform
->
expects
(
$this
->
atLeastOnce
())
$this
->
platform
->
expects
(
self
::
atLeastOnce
())
->
method
(
'getDateTimeFormatString'
)
->
willReturn
(
'Y-m-d H:i:s'
);
...
...
tests/Types/DateTimeTzImmutableTypeTest.php
View file @
300a8e59
...
...
@@ -46,10 +46,10 @@ class DateTimeTzImmutableTypeTest extends TestCase
{
$date
=
$this
->
createMock
(
DateTimeImmutable
::
class
);
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateTimeTzFormatString'
)
->
willReturn
(
'Y-m-d H:i:s T'
);
$date
->
expects
(
$this
->
once
())
$date
->
expects
(
self
::
once
())
->
method
(
'format'
)
->
with
(
'Y-m-d H:i:s T'
)
->
willReturn
(
'2016-01-01 15:58:59 UTC'
);
...
...
@@ -86,7 +86,7 @@ class DateTimeTzImmutableTypeTest extends TestCase
public
function
testConvertsDateTimeWithTimezoneStringToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getDateTimeTzFormatString'
)
->
willReturn
(
'Y-m-d H:i:s T'
);
...
...
@@ -98,7 +98,7 @@ class DateTimeTzImmutableTypeTest extends TestCase
public
function
testThrowsExceptionDuringConversionToPHPValueWithInvalidDateTimeWithTimezoneString
()
:
void
{
$this
->
platform
->
expects
(
$this
->
atLeastOnce
())
$this
->
platform
->
expects
(
self
::
atLeastOnce
())
->
method
(
'getDateTimeTzFormatString'
)
->
willReturn
(
'Y-m-d H:i:s T'
);
...
...
tests/Types/GuidTypeTest.php
View file @
300a8e59
...
...
@@ -37,9 +37,9 @@ class GuidTypeTest extends TestCase
{
self
::
assertTrue
(
$this
->
type
->
requiresSQLCommentHint
(
$this
->
platform
));
$this
->
platform
->
expects
(
$this
->
any
())
$this
->
platform
->
expects
(
self
::
any
())
->
method
(
'hasNativeGuidType'
)
->
will
(
$this
->
returnValue
(
true
));
->
will
(
self
::
returnValue
(
true
));
self
::
assertFalse
(
$this
->
type
->
requiresSQLCommentHint
(
$this
->
platform
));
}
...
...
tests/Types/JsonArrayTest.php
View file @
300a8e59
...
...
@@ -42,7 +42,7 @@ class JsonArrayTest extends TestCase
public
function
testReturnsSQLDeclaration
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getJsonTypeDeclarationSQL'
)
->
willReturn
(
'TEST_JSON'
);
...
...
tests/Types/JsonTest.php
View file @
300a8e59
...
...
@@ -43,7 +43,7 @@ class JsonTest extends TestCase
public
function
testReturnsSQLDeclaration
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getJsonTypeDeclarationSQL'
)
->
willReturn
(
'TEST_JSON'
);
...
...
tests/Types/StringTest.php
View file @
300a8e59
...
...
@@ -24,7 +24,7 @@ class StringTest extends TestCase
public
function
testReturnsSqlDeclarationFromPlatformVarchar
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getVarcharTypeDeclarationSQL'
)
->
willReturn
(
'TEST_VARCHAR'
);
...
...
@@ -33,7 +33,7 @@ class StringTest extends TestCase
public
function
testReturnsDefaultLengthFromPlatformVarchar
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getVarcharDefaultLength'
)
->
willReturn
(
255
);
...
...
tests/Types/TimeImmutableTypeTest.php
View file @
300a8e59
...
...
@@ -46,10 +46,10 @@ class TimeImmutableTypeTest extends TestCase
{
$date
=
$this
->
getMockBuilder
(
DateTimeImmutable
::
class
)
->
getMock
();
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getTimeFormatString'
)
->
willReturn
(
'H:i:s'
);
$date
->
expects
(
$this
->
once
())
$date
->
expects
(
self
::
once
())
->
method
(
'format'
)
->
with
(
'H:i:s'
)
->
willReturn
(
'15:58:59'
);
...
...
@@ -86,7 +86,7 @@ class TimeImmutableTypeTest extends TestCase
public
function
testConvertsTimeStringToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
once
())
$this
->
platform
->
expects
(
self
::
once
())
->
method
(
'getTimeFormatString'
)
->
willReturn
(
'H:i:s'
);
...
...
@@ -98,7 +98,7 @@ class TimeImmutableTypeTest extends TestCase
public
function
testResetDateFractionsWhenConvertingToPHPValue
()
:
void
{
$this
->
platform
->
expects
(
$this
->
any
())
$this
->
platform
->
expects
(
self
::
any
())
->
method
(
'getTimeFormatString'
)
->
willReturn
(
'H:i:s'
);
...
...
tests/Types/VarDateTimeImmutableTypeTest.php
View file @
300a8e59
...
...
@@ -44,7 +44,7 @@ class VarDateTimeImmutableTypeTest extends TestCase
{
$date
=
$this
->
getMockBuilder
(
DateTimeImmutable
::
class
)
->
getMock
();
$date
->
expects
(
$this
->
once
())
$date
->
expects
(
self
::
once
())
->
method
(
'format'
)
->
with
(
'Y-m-d H:i:s'
)
->
willReturn
(
'2016-01-01 15:58:59'
);
...
...
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