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
bcef6bfd
Commit
bcef6bfd
authored
Feb 19, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PHPUnit Deprecation warnings by introducing assertInternalType() and assertInstanceOf().
parent
b94e0091
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
64 additions
and
64 deletions
+64
-64
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+3
-3
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+2
-2
ConnectionTest.php
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
+1
-1
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+6
-6
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+3
-3
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+19
-19
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+4
-4
SchemaTest.php
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
+3
-3
TableTest.php
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
+6
-6
BooleanTest.php
tests/Doctrine/Tests/DBAL/Types/BooleanTest.php
+2
-2
DateTimeTest.php
tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php
+1
-1
DateTimeTzTest.php
tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php
+1
-1
DecimalTest.php
tests/Doctrine/Tests/DBAL/Types/DecimalTest.php
+1
-1
FloatTest.php
tests/Doctrine/Tests/DBAL/Types/FloatTest.php
+2
-2
IntegerTest.php
tests/Doctrine/Tests/DBAL/Types/IntegerTest.php
+2
-2
ObjectTest.php
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
+2
-2
SmallIntTest.php
tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php
+2
-2
StringTest.php
tests/Doctrine/Tests/DBAL/Types/StringTest.php
+2
-2
VarDateTimeTest.php
tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php
+2
-2
No files found.
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
bcef6bfd
...
...
@@ -66,7 +66,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
{
$config
=
$this
->
_conn
->
getConfiguration
();
$this
->
assert
Type
(
'Doctrine\DBAL\Configuration'
,
$config
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Configuration'
,
$config
);
}
public
function
testGetHost
()
...
...
@@ -91,12 +91,12 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public
function
testGetDriver
()
{
$this
->
assert
Type
(
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
$this
->
_conn
->
getDriver
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
$this
->
_conn
->
getDriver
());
}
public
function
testGetEventManager
()
{
$this
->
assert
Type
(
'Doctrine\Common\EventManager'
,
$this
->
_conn
->
getEventManager
());
$this
->
assert
InstanceOf
(
'Doctrine\Common\EventManager'
,
$this
->
_conn
->
getEventManager
());
}
public
function
testConnectDispatchEvent
()
...
...
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
bcef6bfd
...
...
@@ -79,7 +79,7 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
);
$conn
=
\Doctrine\DBAL\DriverManager
::
getConnection
(
$options
);
$this
->
assert
Type
(
$wrapperClass
,
$conn
);
$this
->
assert
InstanceOf
(
$wrapperClass
,
$conn
);
}
public
function
testInvalidWrapperClass
()
...
...
@@ -112,6 +112,6 @@ class DriverManagerTest extends \Doctrine\Tests\DbalTestCase
);
$conn
=
\Doctrine\DBAL\DriverManager
::
getConnection
(
$options
);
$this
->
assert
Type
(
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
$conn
->
getDriver
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Driver\PDOMySql\Driver'
,
$conn
->
getDriver
());
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
View file @
bcef6bfd
...
...
@@ -22,7 +22,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testGetWrappedConnection
()
{
$this
->
assert
Type
(
'Doctrine\DBAL\Driver\Connection'
,
$this
->
_conn
->
getWrappedConnection
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Driver\Connection'
,
$this
->
_conn
->
getWrappedConnection
());
}
public
function
testCommitWithRollbackOnlyThrowsException
()
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
bcef6bfd
...
...
@@ -33,7 +33,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
bindValue
(
1
,
1
);
$stmt
->
bindValue
(
2
,
'foo'
);
...
...
@@ -51,7 +51,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
bindParam
(
1
,
$paramInt
);
$stmt
->
bindParam
(
2
,
$paramStr
);
...
...
@@ -69,7 +69,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
bindParam
(
1
,
$paramInt
);
$stmt
->
bindParam
(
2
,
$paramStr
);
...
...
@@ -87,7 +87,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"SELECT test_int FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
bindParam
(
1
,
$paramInt
);
$stmt
->
bindParam
(
2
,
$paramStr
);
...
...
@@ -106,7 +106,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"SELECT test_int, test_string FROM "
.
$this
->
_conn
->
quoteIdentifier
(
$table
)
.
" "
.
"WHERE test_int = "
.
$this
->
_conn
->
quote
(
$paramInt
)
.
" AND test_string = "
.
$this
->
_conn
->
quote
(
$paramStr
);
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
}
public
function
testPrepareWithExecuteParams
()
...
...
@@ -116,7 +116,7 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"SELECT test_int, test_string FROM fetch_table WHERE test_int = ? AND test_string = ?"
;
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$this
->
assert
Type
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Statement'
,
$stmt
);
$stmt
->
execute
(
array
(
$paramInt
,
$paramStr
));
$row
=
$stmt
->
fetch
(
\PDO
::
FETCH_ASSOC
);
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
bcef6bfd
...
...
@@ -22,13 +22,13 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
_conn
->
exec
(
$createTableSQL
);
$table
=
$this
->
_conn
->
getSchemaManager
()
->
listTableDetails
(
'domain_type_test'
);
$this
->
assert
Type
(
'Doctrine\DBAL\Types\DecimalType'
,
$table
->
getColumn
(
'value'
)
->
getType
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\DecimalType'
,
$table
->
getColumn
(
'value'
)
->
getType
());
Type
::
addType
(
'MyMoney'
,
'Doctrine\Tests\DBAL\Functional\Schema\MoneyType'
);
$this
->
_conn
->
getDatabasePlatform
()
->
registerDoctrineTypeMapping
(
'MyMoney'
,
'MyMoney'
);
$table
=
$this
->
_conn
->
getSchemaManager
()
->
listTableDetails
(
'domain_type_test'
);
$this
->
assert
Type
(
'Doctrine\Tests\DBAL\Functional\Schema\MoneyType'
,
$table
->
getColumn
(
'value'
)
->
getType
());
$this
->
assert
InstanceOf
(
'Doctrine\Tests\DBAL\Functional\Schema\MoneyType'
,
$table
->
getColumn
(
'value'
)
->
getType
());
}
/**
...
...
@@ -91,7 +91,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$c
=
new
\Doctrine\DBAL\Schema\Comparator
();
$diff
=
$c
->
diffTable
(
$tableFrom
,
$tableTo
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\TableDiff'
,
$diff
,
"There should be a difference and not false being returned from the table comparison"
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$diff
,
"There should be a difference and not false being returned from the table comparison"
);
$this
->
assertEquals
(
array
(
"ALTER TABLE autoinc_table_drop ALTER id DROP DEFAULT"
),
$this
->
_conn
->
getDatabasePlatform
()
->
getAlterTableSQL
(
$diff
));
$this
->
_sm
->
alterTable
(
$diff
);
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
bcef6bfd
...
...
@@ -41,11 +41,11 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$sequences
=
$this
->
_sm
->
listSequences
();
$this
->
assertType
(
'array'
,
$sequences
,
'listSequences() should return an array.'
);
$this
->
assert
Internal
Type
(
'array'
,
$sequences
,
'listSequences() should return an array.'
);
$foundSequence
=
null
;
foreach
(
$sequences
AS
$sequence
)
{
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Sequence'
,
$sequence
,
'Array elements of listSequences() should be Sequence instances.'
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Sequence'
,
$sequence
,
'Array elements of listSequences() should be Sequence instances.'
);
if
(
strtolower
(
$sequence
->
getName
())
==
'list_sequences_test_seq'
)
{
$foundSequence
=
$sequence
;
}
...
...
@@ -75,12 +75,12 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
createTestTable
(
'list_tables_test'
);
$tables
=
$this
->
_sm
->
listTables
();
$this
->
assertType
(
'array'
,
$tables
);
$this
->
assert
Internal
Type
(
'array'
,
$tables
);
$this
->
assertTrue
(
count
(
$tables
)
>
0
,
"List Tables has to find at least one table named 'list_tables_test'."
);
$foundTable
=
false
;
foreach
(
$tables
AS
$table
)
{
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Table'
,
$table
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Table'
,
$table
);
if
(
strtolower
(
$table
->
getName
())
==
'list_tables_test'
)
{
$foundTable
=
true
;
...
...
@@ -117,31 +117,31 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertArrayHasKey
(
'id'
,
$columns
);
$this
->
assertEquals
(
'id'
,
strtolower
(
$columns
[
'id'
]
->
getname
()));
$this
->
assert
Type
(
'Doctrine\DBAL\Types\IntegerType'
,
$columns
[
'id'
]
->
gettype
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\IntegerType'
,
$columns
[
'id'
]
->
gettype
());
$this
->
assertEquals
(
false
,
$columns
[
'id'
]
->
getunsigned
());
$this
->
assertEquals
(
true
,
$columns
[
'id'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'id'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'id'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'id'
]
->
getPlatformOptions
());
$this
->
assertArrayHasKey
(
'test'
,
$columns
);
$this
->
assertEquals
(
'test'
,
strtolower
(
$columns
[
'test'
]
->
getname
()));
$this
->
assert
Type
(
'Doctrine\DBAL\Types\StringType'
,
$columns
[
'test'
]
->
gettype
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\StringType'
,
$columns
[
'test'
]
->
gettype
());
$this
->
assertEquals
(
255
,
$columns
[
'test'
]
->
getlength
());
$this
->
assertEquals
(
false
,
$columns
[
'test'
]
->
getfixed
());
$this
->
assertEquals
(
false
,
$columns
[
'test'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'test'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'test'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'test'
]
->
getPlatformOptions
());
$this
->
assertEquals
(
'foo'
,
strtolower
(
$columns
[
'foo'
]
->
getname
()));
$this
->
assert
Type
(
'Doctrine\DBAL\Types\TextType'
,
$columns
[
'foo'
]
->
gettype
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\TextType'
,
$columns
[
'foo'
]
->
gettype
());
$this
->
assertEquals
(
false
,
$columns
[
'foo'
]
->
getunsigned
());
$this
->
assertEquals
(
false
,
$columns
[
'foo'
]
->
getfixed
());
$this
->
assertEquals
(
true
,
$columns
[
'foo'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'foo'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'foo'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'foo'
]
->
getPlatformOptions
());
$this
->
assertEquals
(
'bar'
,
strtolower
(
$columns
[
'bar'
]
->
getname
()));
$this
->
assert
Type
(
'Doctrine\DBAL\Types\DecimalType'
,
$columns
[
'bar'
]
->
gettype
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\DecimalType'
,
$columns
[
'bar'
]
->
gettype
());
$this
->
assertEquals
(
null
,
$columns
[
'bar'
]
->
getlength
());
$this
->
assertEquals
(
10
,
$columns
[
'bar'
]
->
getprecision
());
$this
->
assertEquals
(
4
,
$columns
[
'bar'
]
->
getscale
());
...
...
@@ -149,25 +149,25 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertEquals
(
false
,
$columns
[
'bar'
]
->
getfixed
());
$this
->
assertEquals
(
false
,
$columns
[
'bar'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'bar'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'bar'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'bar'
]
->
getPlatformOptions
());
$this
->
assertEquals
(
'baz1'
,
strtolower
(
$columns
[
'baz1'
]
->
getname
()));
$this
->
assert
Type
(
'Doctrine\DBAL\Types\DateTimeType'
,
$columns
[
'baz1'
]
->
gettype
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Types\DateTimeType'
,
$columns
[
'baz1'
]
->
gettype
());
$this
->
assertEquals
(
true
,
$columns
[
'baz1'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'baz1'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'baz1'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'baz1'
]
->
getPlatformOptions
());
$this
->
assertEquals
(
'baz2'
,
strtolower
(
$columns
[
'baz2'
]
->
getname
()));
$this
->
assertContains
(
$columns
[
'baz2'
]
->
gettype
()
->
getName
(),
array
(
'time'
,
'date'
,
'datetime'
));
$this
->
assertEquals
(
true
,
$columns
[
'baz2'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'baz2'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'baz2'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'baz2'
]
->
getPlatformOptions
());
$this
->
assertEquals
(
'baz3'
,
strtolower
(
$columns
[
'baz3'
]
->
getname
()));
$this
->
assertContains
(
$columns
[
'baz2'
]
->
gettype
()
->
getName
(),
array
(
'time'
,
'date'
,
'datetime'
));
$this
->
assertEquals
(
true
,
$columns
[
'baz3'
]
->
getnotnull
());
$this
->
assertEquals
(
null
,
$columns
[
'baz3'
]
->
getdefault
());
$this
->
assertType
(
'array'
,
$columns
[
'baz3'
]
->
getPlatformOptions
());
$this
->
assert
Internal
Type
(
'array'
,
$columns
[
'baz3'
]
->
getPlatformOptions
());
}
public
function
testDiffListTableColumns
()
...
...
@@ -221,7 +221,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
_sm
->
dropAndCreateIndex
(
$table
->
getIndex
(
'test'
),
$table
);
$tableIndexes
=
$this
->
_sm
->
listTableIndexes
(
'test_create_index'
);
$this
->
assertType
(
'array'
,
$tableIndexes
);
$this
->
assert
Internal
Type
(
'array'
,
$tableIndexes
);
$this
->
assertEquals
(
'test'
,
strtolower
(
$tableIndexes
[
'test'
]
->
getName
()));
$this
->
assertEquals
(
array
(
'test'
),
array_map
(
'strtolower'
,
$tableIndexes
[
'test'
]
->
getColumns
()));
...
...
@@ -276,7 +276,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertEquals
(
1
,
count
(
$fkeys
),
"Table 'test_create_fk1' has to have one foreign key."
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\ForeignKeyConstraint'
,
$fkeys
[
0
]);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\ForeignKeyConstraint'
,
$fkeys
[
0
]);
$this
->
assertEquals
(
array
(
'foreign_key_test'
),
array_map
(
'strtolower'
,
$fkeys
[
0
]
->
getLocalColumns
()));
$this
->
assertEquals
(
array
(
'id'
),
array_map
(
'strtolower'
,
$fkeys
[
0
]
->
getForeignColumns
()));
$this
->
assertEquals
(
'test_create_fk2'
,
strtolower
(
$fkeys
[
0
]
->
getForeignTableName
()));
...
...
@@ -428,7 +428,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
{
$foundTable
=
false
;
foreach
(
$tables
AS
$table
)
{
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Table'
,
$table
,
'No Table instance was found in tables array.'
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Table'
,
$table
,
'No Table instance was found in tables array.'
);
if
(
strtolower
(
$table
->
getName
())
==
'list_tables_test_new_name'
)
{
$foundTable
=
true
;
}
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
bcef6bfd
...
...
@@ -426,7 +426,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$c
=
new
Comparator
();
$tableDiff
=
$c
->
diffTable
(
$table1
,
$table2
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assertEquals
(
1
,
count
(
$tableDiff
->
addedForeignKeys
));
}
...
...
@@ -445,7 +445,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$c
=
new
Comparator
();
$tableDiff
=
$c
->
diffTable
(
$table2
,
$table1
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assertEquals
(
1
,
count
(
$tableDiff
->
removedForeignKeys
));
}
...
...
@@ -465,7 +465,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$c
=
new
Comparator
();
$tableDiff
=
$c
->
diffTable
(
$table1
,
$table2
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assertEquals
(
1
,
count
(
$tableDiff
->
changedForeignKeys
));
}
...
...
@@ -621,7 +621,7 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$c
=
new
Comparator
();
$tableDiff
=
$c
->
diffTable
(
$tableA
,
$tableB
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\TableDiff'
,
$tableDiff
);
$this
->
assertArrayHasKey
(
'id'
,
$tableDiff
->
changedColumns
);
}
...
...
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
View file @
bcef6bfd
...
...
@@ -92,7 +92,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$table
=
$schema
->
createTable
(
"foo"
);
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Table'
,
$table
);
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Table'
,
$table
);
$this
->
assertEquals
(
"foo"
,
$table
->
getName
());
$this
->
assertTrue
(
$schema
->
hasTable
(
"foo"
));
}
...
...
@@ -104,7 +104,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$schema
=
new
Schema
(
array
(),
array
(
$sequence
));
$this
->
assertTrue
(
$schema
->
hasSequence
(
"a_seq"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Sequence'
,
$schema
->
getSequence
(
"a_seq"
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Sequence'
,
$schema
->
getSequence
(
"a_seq"
));
$sequences
=
$schema
->
getSequences
();
$this
->
assertArrayHasKey
(
'a_seq'
,
$sequences
);
...
...
@@ -142,7 +142,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
20
,
$sequence
->
getInitialValue
());
$this
->
assertTrue
(
$schema
->
hasSequence
(
"a_seq"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Sequence'
,
$schema
->
getSequence
(
"a_seq"
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Sequence'
,
$schema
->
getSequence
(
"a_seq"
));
$sequences
=
$schema
->
getSequences
();
$this
->
assertArrayHasKey
(
'a_seq'
,
$sequences
);
...
...
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
View file @
bcef6bfd
...
...
@@ -38,8 +38,8 @@ class TableTest extends \PHPUnit_Framework_TestCase
$this
->
assertTrue
(
$table
->
hasColumn
(
"bar"
));
$this
->
assertFalse
(
$table
->
hasColumn
(
"baz"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Column'
,
$table
->
getColumn
(
"foo"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Column'
,
$table
->
getColumn
(
"bar"
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Column'
,
$table
->
getColumn
(
"foo"
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Column'
,
$table
->
getColumn
(
"bar"
));
$this
->
assertEquals
(
2
,
count
(
$table
->
getColumns
()));
}
...
...
@@ -153,9 +153,9 @@ class TableTest extends \PHPUnit_Framework_TestCase
$this
->
assertTrue
(
$table
->
hasIndex
(
"bar_idx"
));
$this
->
assertFalse
(
$table
->
hasIndex
(
"some_idx"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getPrimaryKey
());
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getIndex
(
'the_primary'
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getIndex
(
'bar_idx'
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getPrimaryKey
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getIndex
(
'the_primary'
));
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getIndex
(
'bar_idx'
));
}
public
function
testGetUnknownIndexThrowsException
()
...
...
@@ -219,7 +219,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
$table
->
setPrimaryKey
(
array
(
"bar"
));
$this
->
assertTrue
(
$table
->
hasIndex
(
"primary"
));
$this
->
assert
Type
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getPrimaryKey
());
$this
->
assert
InstanceOf
(
'Doctrine\DBAL\Schema\Index'
,
$table
->
getPrimaryKey
());
$this
->
assertTrue
(
$table
->
getIndex
(
"primary"
)
->
isUnique
());
$this
->
assertTrue
(
$table
->
getIndex
(
"primary"
)
->
isPrimary
());
}
...
...
tests/Doctrine/Tests/DBAL/Types/BooleanTest.php
View file @
bcef6bfd
...
...
@@ -21,12 +21,12 @@ class BooleanTest extends \Doctrine\Tests\DbalTestCase
public
function
testBooleanConvertsToDatabaseValue
()
{
$this
->
assertType
(
'integer'
,
$this
->
_type
->
convertToDatabaseValue
(
1
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'integer'
,
$this
->
_type
->
convertToDatabaseValue
(
1
,
$this
->
_platform
));
}
public
function
testBooleanConvertsToPHPValue
()
{
$this
->
assertType
(
'bool'
,
$this
->
_type
->
convertToPHPValue
(
0
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'bool'
,
$this
->
_type
->
convertToPHPValue
(
0
,
$this
->
_platform
));
}
public
function
testBooleanNullConvertsToPHPValue
()
...
...
tests/Doctrine/Tests/DBAL/Types/DateTimeTest.php
View file @
bcef6bfd
...
...
@@ -33,7 +33,7 @@ class DateTimeTest extends \Doctrine\Tests\DbalTestCase
{
// Birthday of jwage and also birthday of Doctrine. Send him a present ;)
$date
=
$this
->
_type
->
convertToPHPValue
(
'1985-09-01 00:00:00'
,
$this
->
_platform
);
$this
->
assert
Type
(
'DateTime'
,
$date
);
$this
->
assert
InstanceOf
(
'DateTime'
,
$date
);
$this
->
assertEquals
(
'1985-09-01 00:00:00'
,
$date
->
format
(
'Y-m-d H:i:s'
));
}
...
...
tests/Doctrine/Tests/DBAL/Types/DateTimeTzTest.php
View file @
bcef6bfd
...
...
@@ -33,7 +33,7 @@ class DateTimeTzTest extends \Doctrine\Tests\DbalTestCase
{
// Birthday of jwage and also birthday of Doctrine. Send him a present ;)
$date
=
$this
->
_type
->
convertToPHPValue
(
'1985-09-01 00:00:00'
,
$this
->
_platform
);
$this
->
assert
Type
(
'DateTime'
,
$date
);
$this
->
assert
InstanceOf
(
'DateTime'
,
$date
);
$this
->
assertEquals
(
'1985-09-01 00:00:00'
,
$date
->
format
(
'Y-m-d H:i:s'
));
}
...
...
tests/Doctrine/Tests/DBAL/Types/DecimalTest.php
View file @
bcef6bfd
...
...
@@ -21,7 +21,7 @@ class DecimalTest extends \Doctrine\Tests\DbalTestCase
public
function
testDecimalConvertsToPHPValue
()
{
$this
->
assertType
(
'float'
,
$this
->
_type
->
convertToPHPValue
(
'5.5'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'float'
,
$this
->
_type
->
convertToPHPValue
(
'5.5'
,
$this
->
_platform
));
}
public
function
testDecimalNullConvertsToPHPValue
()
...
...
tests/Doctrine/Tests/DBAL/Types/FloatTest.php
View file @
bcef6bfd
...
...
@@ -19,7 +19,7 @@ class FloatTest extends \Doctrine\Tests\DbalTestCase
public
function
testFloatConvertsToPHPValue
()
{
$this
->
assertType
(
'float'
,
$this
->
_type
->
convertToPHPValue
(
'5.5'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'float'
,
$this
->
_type
->
convertToPHPValue
(
'5.5'
,
$this
->
_platform
));
}
public
function
testFloatNullConvertsToPHPValue
()
...
...
@@ -29,7 +29,7 @@ class FloatTest extends \Doctrine\Tests\DbalTestCase
public
function
testFloatConvertToDatabaseValue
()
{
$this
->
assertType
(
'float'
,
$this
->
_type
->
convertToDatabaseValue
(
5.5
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'float'
,
$this
->
_type
->
convertToDatabaseValue
(
5.5
,
$this
->
_platform
));
}
public
function
testFloatNullConvertToDatabaseValue
()
...
...
tests/Doctrine/Tests/DBAL/Types/IntegerTest.php
View file @
bcef6bfd
...
...
@@ -21,8 +21,8 @@ class IntegerTest extends \Doctrine\Tests\DbalTestCase
public
function
testIntegerConvertsToPHPValue
()
{
$this
->
assertType
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'1'
,
$this
->
_platform
));
$this
->
assertType
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'0'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'1'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'0'
,
$this
->
_platform
));
}
public
function
testIntegerNullConvertsToPHPValue
()
...
...
tests/Doctrine/Tests/DBAL/Types/ObjectTest.php
View file @
bcef6bfd
...
...
@@ -26,12 +26,12 @@ class ObjectTest extends \Doctrine\Tests\DbalTestCase
public
function
testObjectConvertsToDatabaseValue
()
{
$this
->
assertType
(
'string'
,
$this
->
_type
->
convertToDatabaseValue
(
new
\stdClass
(),
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'string'
,
$this
->
_type
->
convertToDatabaseValue
(
new
\stdClass
(),
$this
->
_platform
));
}
public
function
testObjectConvertsToPHPValue
()
{
$this
->
assertType
(
'object'
,
$this
->
_type
->
convertToPHPValue
(
serialize
(
new
\stdClass
),
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'object'
,
$this
->
_type
->
convertToPHPValue
(
serialize
(
new
\stdClass
),
$this
->
_platform
));
}
public
function
testConversionFailure
()
...
...
tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php
View file @
bcef6bfd
...
...
@@ -21,8 +21,8 @@ class SmallIntTest extends \Doctrine\Tests\DbalTestCase
public
function
testSmallIntConvertsToPHPValue
()
{
$this
->
assertType
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'1'
,
$this
->
_platform
));
$this
->
assertType
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'0'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'1'
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
'integer'
,
$this
->
_type
->
convertToPHPValue
(
'0'
,
$this
->
_platform
));
}
public
function
testSmallIntNullConvertsToPHPValue
()
...
...
tests/Doctrine/Tests/DBAL/Types/StringTest.php
View file @
bcef6bfd
...
...
@@ -31,8 +31,8 @@ class StringTest extends \Doctrine\Tests\DbalTestCase
public
function
testConvertToPHPValue
()
{
$this
->
assertType
(
"string"
,
$this
->
_type
->
convertToPHPValue
(
"foo"
,
$this
->
_platform
));
$this
->
assertType
(
"string"
,
$this
->
_type
->
convertToPHPValue
(
""
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
"string"
,
$this
->
_type
->
convertToPHPValue
(
"foo"
,
$this
->
_platform
));
$this
->
assert
Internal
Type
(
"string"
,
$this
->
_type
->
convertToPHPValue
(
""
,
$this
->
_platform
));
}
public
function
testNullConversion
()
...
...
tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php
View file @
bcef6bfd
...
...
@@ -36,7 +36,7 @@ class VarDateTimeTest extends \Doctrine\Tests\DbalTestCase
{
// Birthday of jwage and also birthday of Doctrine. Send him a present ;)
$date
=
$this
->
_type
->
convertToPHPValue
(
'1985-09-01 00:00:00'
,
$this
->
_platform
);
$this
->
assert
Type
(
'DateTime'
,
$date
);
$this
->
assert
InstanceOf
(
'DateTime'
,
$date
);
$this
->
assertEquals
(
'1985-09-01 00:00:00'
,
$date
->
format
(
'Y-m-d H:i:s'
));
$this
->
assertEquals
(
'000000'
,
$date
->
format
(
'u'
));
}
...
...
@@ -50,7 +50,7 @@ class VarDateTimeTest extends \Doctrine\Tests\DbalTestCase
public
function
testConversionWithMicroseconds
()
{
$date
=
$this
->
_type
->
convertToPHPValue
(
'1985-09-01 00:00:00.123456'
,
$this
->
_platform
);
$this
->
assert
Type
(
'DateTime'
,
$date
);
$this
->
assert
InstanceOf
(
'DateTime'
,
$date
);
$this
->
assertEquals
(
'1985-09-01 00:00:00'
,
$date
->
format
(
'Y-m-d H:i:s'
));
$this
->
assertEquals
(
'123456'
,
$date
->
format
(
'u'
));
}
...
...
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