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
a7a8f31a
Commit
a7a8f31a
authored
Jul 27, 2014
by
jeroendedauw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
foreach AS -> foreach as
parent
3065aff5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
30 deletions
+30
-30
ExceptionTest.php
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
+11
-11
ModifyLimitQueryTest.php
...s/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php
+1
-1
PortabilityTest.php
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
+1
-1
ResultCacheTest.php
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
+5
-5
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+3
-3
TemporaryTableTest.php
tests/Doctrine/Tests/DBAL/Functional/TemporaryTableTest.php
+2
-2
TypeConversionTest.php
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
+1
-1
WriteTest.php
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
+1
-1
MySQLSchemaTest.php
.../Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php
+1
-1
DbalFunctionalTestCase.php
tests/Doctrine/Tests/DbalFunctionalTestCase.php
+2
-2
TestUtil.php
tests/Doctrine/Tests/TestUtil.php
+2
-2
No files found.
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
View file @
a7a8f31a
...
...
@@ -20,7 +20,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'id'
,
'integer'
,
array
());
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -46,10 +46,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
setPrimaryKey
(
array
(
'id'
));
$this
->
setExpectedException
(
'\Doctrine\DBAL\Exception\TableExistsException'
);
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
...
...
@@ -72,7 +72,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$owningTable
->
setPrimaryKey
(
array
(
'id'
));
$owningTable
->
addForeignKeyConstraint
(
$table
,
array
(
'constraint_id'
),
array
(
'id'
));
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -92,7 +92,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'value'
,
'integer'
,
array
(
'notnull'
=>
true
));
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -107,7 +107,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
=
$schema
->
createTable
(
"bad_fieldname_table"
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
());
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -125,7 +125,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table2
=
$schema
->
createTable
(
"ambiguous_list_table_2"
);
$table2
->
addColumn
(
'id'
,
'integer'
);
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -142,7 +142,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'id'
,
'integer'
);
$table
->
addUniqueIndex
(
array
(
'id'
));
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$this
->
_conn
->
getDatabasePlatform
())
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -157,7 +157,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'id'
,
'integer'
,
array
());
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -195,7 +195,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'id'
,
'integer'
);
$this
->
setExpectedException
(
$exceptionClass
);
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
as
$sql
)
{
$conn
->
executeQuery
(
$sql
);
}
}
...
...
@@ -236,7 +236,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this
->
setExpectedException
(
'Doctrine\DBAL\Exception\ConnectionException'
);
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
AS
$sql
)
{
foreach
(
$schema
->
toSql
(
$conn
->
getDatabasePlatform
())
as
$sql
)
{
$conn
->
executeQuery
(
$sql
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php
View file @
a7a8f31a
...
...
@@ -116,7 +116,7 @@ class ModifyLimitQueryTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$p
=
$this
->
_conn
->
getDatabasePlatform
();
$data
=
array
();
foreach
(
$this
->
_conn
->
fetchAll
(
$p
->
modifyLimitQuery
(
$sql
,
$limit
,
$offset
))
AS
$row
)
{
foreach
(
$this
->
_conn
->
fetchAll
(
$p
->
modifyLimitQuery
(
$sql
,
$limit
,
$offset
))
as
$row
)
{
$row
=
array_change_key_case
(
$row
,
CASE_LOWER
);
$data
[]
=
$row
[
'test_int'
];
}
...
...
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
View file @
a7a8f31a
...
...
@@ -109,7 +109,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
assertFetchResultRows
(
$rows
)
{
$this
->
assertEquals
(
2
,
count
(
$rows
));
foreach
(
$rows
AS
$row
)
{
foreach
(
$rows
as
$row
)
{
$this
->
assertFetchResultRow
(
$row
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
View file @
a7a8f31a
...
...
@@ -31,7 +31,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
$this
->
_conn
->
executeUpdate
(
'DELETE FROM caching'
);
foreach
(
$this
->
expectedResult
AS
$row
)
{
foreach
(
$this
->
expectedResult
as
$row
)
{
$this
->
_conn
->
insert
(
'caching'
,
$row
);
}
...
...
@@ -50,7 +50,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testFetchNum
()
{
$expectedResult
=
array
();
foreach
(
$this
->
expectedResult
AS
$v
)
{
foreach
(
$this
->
expectedResult
as
$v
)
{
$expectedResult
[]
=
array_values
(
$v
);
}
$this
->
assertCacheNonCacheSelectSameFetchModeAreEqual
(
$expectedResult
,
\PDO
::
FETCH_NUM
);
...
...
@@ -59,7 +59,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testFetchBoth
()
{
$expectedResult
=
array
();
foreach
(
$this
->
expectedResult
AS
$v
)
{
foreach
(
$this
->
expectedResult
as
$v
)
{
$expectedResult
[]
=
array_merge
(
$v
,
array_values
(
$v
));
}
$this
->
assertCacheNonCacheSelectSameFetchModeAreEqual
(
$expectedResult
,
\PDO
::
FETCH_BOTH
);
...
...
@@ -68,7 +68,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testFetchColumn
()
{
$expectedResult
=
array
();
foreach
(
$this
->
expectedResult
AS
$v
)
{
foreach
(
$this
->
expectedResult
as
$v
)
{
$expectedResult
[]
=
array_shift
(
$v
);
}
$this
->
assertCacheNonCacheSelectSameFetchModeAreEqual
(
$expectedResult
,
\PDO
::
FETCH_COLUMN
);
...
...
@@ -77,7 +77,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testMixingFetch
()
{
$numExpectedResult
=
array
();
foreach
(
$this
->
expectedResult
AS
$v
)
{
foreach
(
$this
->
expectedResult
as
$v
)
{
$numExpectedResult
[]
=
array_values
(
$v
);
}
$stmt
=
$this
->
_conn
->
executeQuery
(
"SELECT * FROM caching ORDER BY test_int ASC"
,
array
(),
array
(),
new
QueryCacheProfile
(
10
,
"testcachekey"
));
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
a7a8f31a
...
...
@@ -69,7 +69,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertInternalType
(
'array'
,
$sequences
,
'listSequences() should return an array.'
);
$foundSequence
=
null
;
foreach
(
$sequences
AS
$sequence
)
{
foreach
(
$sequences
as
$sequence
)
{
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Schema\Sequence'
,
$sequence
,
'Array elements of listSequences() should be Sequence instances.'
);
if
(
strtolower
(
$sequence
->
getName
())
==
'list_sequences_test_seq'
)
{
$foundSequence
=
$sequence
;
...
...
@@ -104,7 +104,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertTrue
(
count
(
$tables
)
>
0
,
"List Tables has to find at least one table named 'list_tables_test'."
);
$foundTable
=
false
;
foreach
(
$tables
AS
$table
)
{
foreach
(
$tables
as
$table
)
{
$this
->
assertInstanceOf
(
'Doctrine\DBAL\Schema\Table'
,
$table
);
if
(
strtolower
(
$table
->
getName
())
==
'list_tables_test'
)
{
$foundTable
=
true
;
...
...
@@ -722,7 +722,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
protected
function
assertHasTable
(
$tables
,
$tableName
)
{
$foundTable
=
false
;
foreach
(
$tables
AS
$table
)
{
foreach
(
$tables
as
$table
)
{
$this
->
assertInstanceOf
(
'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/Functional/TemporaryTableTest.php
View file @
a7a8f31a
...
...
@@ -50,7 +50,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
"id"
,
"integer"
);
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
@@ -87,7 +87,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
"id"
,
"integer"
);
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$platform
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
...
...
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
View file @
a7a8f31a
...
...
@@ -36,7 +36,7 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
setPrimaryKey
(
array
(
'id'
));
try
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
catch
(
\Exception
$e
)
{
...
...
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
View file @
a7a8f31a
...
...
@@ -18,7 +18,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table
->
addColumn
(
'test_string'
,
'string'
,
array
(
'notnull'
=>
false
));
$table
->
setPrimaryKey
(
array
(
'id'
));
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
as
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
catch
(
\Exception
$e
)
{
...
...
tests/Doctrine/Tests/DBAL/Schema/Platforms/MySQLSchemaTest.php
View file @
a7a8f31a
...
...
@@ -55,7 +55,7 @@ class MySQLSchemaTest extends \PHPUnit_Framework_TestCase
$tableOld
->
addUnnamedForeignKeyConstraint
(
'test_foreign'
,
array
(
'foo_id'
),
array
(
'foo_id'
));
$sqls
=
array
();
foreach
(
$tableOld
->
getForeignKeys
()
AS
$fk
)
{
foreach
(
$tableOld
->
getForeignKeys
()
as
$fk
)
{
$sqls
[]
=
$this
->
platform
->
getCreateForeignKeySQL
(
$fk
,
$tableOld
);
}
...
...
tests/Doctrine/Tests/DbalFunctionalTestCase.php
View file @
a7a8f31a
...
...
@@ -49,7 +49,7 @@ class DbalFunctionalTestCase extends DbalTestCase
if
(
isset
(
$this
->
_sqlLoggerStack
->
queries
)
&&
count
(
$this
->
_sqlLoggerStack
->
queries
))
{
$queries
=
""
;
$i
=
count
(
$this
->
_sqlLoggerStack
->
queries
);
foreach
(
array_reverse
(
$this
->
_sqlLoggerStack
->
queries
)
AS
$query
)
{
foreach
(
array_reverse
(
$this
->
_sqlLoggerStack
->
queries
)
as
$query
)
{
$params
=
array_map
(
function
(
$p
)
{
if
(
is_object
(
$p
))
return
get_class
(
$p
);
else
return
"'"
.
$p
.
"'"
;
},
$query
[
'params'
]
?:
array
());
$queries
.=
(
$i
+
1
)
.
". SQL: '"
.
$query
[
'sql'
]
.
"' Params: "
.
implode
(
", "
,
$params
)
.
PHP_EOL
;
$i
--
;
...
...
@@ -57,7 +57,7 @@ class DbalFunctionalTestCase extends DbalTestCase
$trace
=
$e
->
getTrace
();
$traceMsg
=
""
;
foreach
(
$trace
AS
$part
)
{
foreach
(
$trace
as
$part
)
{
if
(
isset
(
$part
[
'file'
]))
{
if
(
strpos
(
$part
[
'file'
],
"PHPUnit/"
)
!==
false
)
{
// Beginning with PHPUnit files we don't print the trace anymore.
...
...
tests/Doctrine/Tests/TestUtil.php
View file @
a7a8f31a
...
...
@@ -60,7 +60,7 @@ class TestUtil
$schema
=
$sm
->
createSchema
();
$stmts
=
$schema
->
toDropSql
(
$realConn
->
getDatabasePlatform
());
foreach
(
$stmts
AS
$stmt
)
{
foreach
(
$stmts
as
$stmt
)
{
$realConn
->
exec
(
$stmt
);
}
}
...
...
@@ -80,7 +80,7 @@ class TestUtil
if
(
isset
(
$GLOBALS
[
'db_event_subscribers'
]))
{
$evm
=
$conn
->
getEventManager
();
foreach
(
explode
(
","
,
$GLOBALS
[
'db_event_subscribers'
])
AS
$subscriberClass
)
{
foreach
(
explode
(
","
,
$GLOBALS
[
'db_event_subscribers'
])
as
$subscriberClass
)
{
$subscriberInstance
=
new
$subscriberClass
();
$evm
->
addEventSubscriber
(
$subscriberInstance
);
}
...
...
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