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
be4253f5
Unverified
Commit
be4253f5
authored
Jan 30, 2018
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More code style fixes
parent
41906695
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
371 additions
and
183 deletions
+371
-183
ArrayStatement.php
lib/Doctrine/DBAL/Cache/ArrayStatement.php
+1
-1
SQLSrvStatement.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
+1
-1
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+12
-12
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+313
-143
BlobTest.php
tests/Doctrine/Tests/DBAL/Functional/BlobTest.php
+31
-14
PortabilityTest.php
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
+1
-1
StatementTest.php
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
+1
-3
DBAL630Test.php
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
+2
-2
WriteTest.php
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
+5
-5
QueryBuilderTest.php
tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php
+4
-1
No files found.
lib/Doctrine/DBAL/Cache/ArrayStatement.php
View file @
be4253f5
...
@@ -123,7 +123,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
...
@@ -123,7 +123,7 @@ class ArrayStatement implements \IteratorAggregate, ResultStatement
return
reset
(
$row
);
return
reset
(
$row
);
}
}
throw
new
\InvalidArgumentException
(
"Invalid fetch-style given for fetching result."
);
throw
new
\InvalidArgumentException
(
'Invalid fetch-style given for fetching result.'
);
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
View file @
be4253f5
...
@@ -96,7 +96,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
...
@@ -96,7 +96,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
/**
/**
* The fetch style.
* The fetch style.
*
*
* @
param
int
* @
var
int
*/
*/
private
$defaultFetchMode
=
FetchMode
::
MIXED
;
private
$defaultFetchMode
=
FetchMode
::
MIXED
;
...
...
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
be4253f5
...
@@ -495,9 +495,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -495,9 +495,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public
function
testFetchAssoc
()
public
function
testFetchAssoc
()
{
{
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
array
(
666
)
;
$params
=
[
666
]
;
$types
=
array
(
ParameterType
::
INTEGER
)
;
$types
=
[
ParameterType
::
INTEGER
]
;
$result
=
array
()
;
$result
=
[]
;
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
...
@@ -531,9 +531,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -531,9 +531,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public
function
testFetchArray
()
public
function
testFetchArray
()
{
{
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
array
(
666
)
;
$params
=
[
666
]
;
$types
=
array
(
ParameterType
::
INTEGER
)
;
$types
=
[
ParameterType
::
INTEGER
]
;
$result
=
array
()
;
$result
=
[]
;
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
...
@@ -567,10 +567,10 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -567,10 +567,10 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public
function
testFetchColumn
()
public
function
testFetchColumn
()
{
{
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
array
(
666
)
;
$params
=
[
666
]
;
$types
=
array
(
ParameterType
::
INTEGER
)
;
$types
=
[
ParameterType
::
INTEGER
]
;
$column
=
0
;
$column
=
0
;
$result
=
array
()
;
$result
=
[]
;
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
...
@@ -627,9 +627,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
...
@@ -627,9 +627,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase
public
function
testFetchAll
()
public
function
testFetchAll
()
{
{
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$statement
=
'SELECT * FROM foo WHERE bar = ?'
;
$params
=
array
(
666
)
;
$params
=
[
666
]
;
$types
=
array
(
ParameterType
::
INTEGER
)
;
$types
=
[
ParameterType
::
INTEGER
]
;
$result
=
array
()
;
$result
=
[]
;
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
$driverMock
=
$this
->
createMock
(
'Doctrine\DBAL\Driver'
);
...
...
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
be4253f5
This diff is collapsed.
Click to expand it.
tests/Doctrine/Tests/DBAL/Functional/BlobTest.php
View file @
be4253f5
...
@@ -54,26 +54,43 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -54,26 +54,43 @@ class BlobTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testSelect
()
public
function
testSelect
()
{
{
$this
->
_conn
->
insert
(
'blob_table'
,
$this
->
_conn
->
insert
(
'blob_table'
,
[
array
(
'id'
=>
1
,
'clobfield'
=>
'test'
,
'blobfield'
=>
'test'
,
'binaryfield'
=>
'test'
),
'id'
=>
1
,
array
(
ParameterType
::
INTEGER
,
ParameterType
::
STRING
,
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
LARGE_OBJECT
)
'clobfield'
=>
'test'
,
);
'blobfield'
=>
'test'
,
'binaryfield'
=>
'test'
,
],
[
ParameterType
::
INTEGER
,
ParameterType
::
STRING
,
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
LARGE_OBJECT
,
]);
$this
->
assertBlobContains
(
'test'
);
$this
->
assertBlobContains
(
'test'
);
}
}
public
function
testUpdate
()
public
function
testUpdate
()
{
{
$this
->
_conn
->
insert
(
'blob_table'
,
$this
->
_conn
->
insert
(
'blob_table'
,
[
array
(
'id'
=>
1
,
'clobfield'
=>
'test'
,
'blobfield'
=>
'test'
,
'binaryfield'
=>
'test'
),
'id'
=>
1
,
array
(
ParameterType
::
INTEGER
,
ParameterType
::
STRING
,
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
LARGE_OBJECT
)
'clobfield'
=>
'test'
,
);
'blobfield'
=>
'test'
,
'binaryfield'
=>
'test'
,
$this
->
_conn
->
update
(
'blob_table'
,
],
[
array
(
'blobfield'
=>
'test2'
,
'binaryfield'
=>
'test2'
),
ParameterType
::
INTEGER
,
array
(
'id'
=>
1
),
ParameterType
::
STRING
,
array
(
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
INTEGER
)
ParameterType
::
LARGE_OBJECT
,
);
ParameterType
::
LARGE_OBJECT
,
]);
$this
->
_conn
->
update
(
'blob_table'
,
[
'blobfield'
=>
'test2'
,
'binaryfield'
=>
'test2'
,
],
[
'id'
=>
1
],
[
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
LARGE_OBJECT
,
ParameterType
::
INTEGER
,
]);
$this
->
assertBlobContains
(
'test2'
);
$this
->
assertBlobContains
(
'test2'
);
$this
->
assertBinaryContains
(
'test2'
);
$this
->
assertBinaryContains
(
'test2'
);
...
...
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php
View file @
be4253f5
...
@@ -128,7 +128,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -128,7 +128,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
self
::
assertArrayHasKey
(
'test_string'
,
$row
,
"Case should be lowered."
);
self
::
assertArrayHasKey
(
'test_string'
,
$row
,
"Case should be lowered."
);
self
::
assertEquals
(
3
,
strlen
(
$row
[
'test_string'
]),
"test_string should be rtrimed to length of three for CHAR(32) column."
);
self
::
assertEquals
(
3
,
strlen
(
$row
[
'test_string'
]),
"test_string should be rtrimed to length of three for CHAR(32) column."
);
self
::
assertNull
(
$row
[
'test_null'
]);
self
::
assertNull
(
$row
[
'test_null'
]);
self
::
assertArrayNotHasKey
(
0
,
$row
,
"The row should not contain numerical keys."
);
self
::
assertArrayNotHasKey
(
0
,
$row
,
'The row should not contain numerical keys.'
);
}
}
/**
/**
...
...
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php
View file @
be4253f5
...
@@ -104,9 +104,7 @@ d+N0hqezcjblboJ3Bj8ARJilHX4FAAA=
...
@@ -104,9 +104,7 @@ d+N0hqezcjblboJ3Bj8ARJilHX4FAAA=
EOF
EOF
);
);
$this
->
_conn
->
insert
(
'stmt_long_blob'
,
array
(
$this
->
_conn
->
insert
(
'stmt_long_blob'
,
[
'contents'
=>
$contents
],
[
ParameterType
::
LARGE_OBJECT
]);
'contents'
=>
$contents
,
),
array
(
ParameterType
::
LARGE_OBJECT
));
$stmt
=
$this
->
_conn
->
prepare
(
'SELECT contents FROM stmt_long_blob'
);
$stmt
=
$this
->
_conn
->
prepare
(
'SELECT contents FROM stmt_long_blob'
);
$stmt
->
execute
();
$stmt
->
execute
();
...
...
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
View file @
be4253f5
...
@@ -55,8 +55,8 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -55,8 +55,8 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
{
{
$this
->
_conn
->
executeUpdate
(
$this
->
_conn
->
executeUpdate
(
'INSERT INTO dbal630 (bool_col) VALUES(?)'
,
'INSERT INTO dbal630 (bool_col) VALUES(?)'
,
array
(
'false'
)
,
[
'false'
]
,
array
(
ParameterType
::
BOOLEAN
)
[
ParameterType
::
BOOLEAN
]
);
);
$id
=
$this
->
_conn
->
lastInsertId
(
'dbal630_id_seq'
);
$id
=
$this
->
_conn
->
lastInsertId
(
'dbal630_id_seq'
);
self
::
assertNotEmpty
(
$id
);
self
::
assertNotEmpty
(
$id
);
...
...
tests/Doctrine/Tests/DBAL/Functional/WriteTest.php
View file @
be4253f5
...
@@ -32,10 +32,10 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -32,10 +32,10 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testExecuteUpdateFirstTypeIsNull
()
public
function
testExecuteUpdateFirstTypeIsNull
()
{
{
$sql
=
"INSERT INTO write_table (test_string, test_int) VALUES (?, ?)"
;
$sql
=
"INSERT INTO write_table (test_string, test_int) VALUES (?, ?)"
;
$this
->
_conn
->
executeUpdate
(
$sql
,
array
(
"text"
,
1111
),
array
(
null
,
ParameterType
::
INTEGER
)
);
$this
->
_conn
->
executeUpdate
(
$sql
,
[
'text'
,
1111
],
[
null
,
ParameterType
::
INTEGER
]
);
$sql
=
"SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"
;
$sql
=
"SELECT * FROM write_table WHERE test_string = ? AND test_int = ?"
;
self
::
assertTrue
((
bool
)
$this
->
_conn
->
fetchColumn
(
$sql
,
array
(
"text"
,
1111
)
));
self
::
assertTrue
((
bool
)
$this
->
_conn
->
fetchColumn
(
$sql
,
[
'text'
,
1111
]
));
}
}
public
function
testExecuteUpdate
()
public
function
testExecuteUpdate
()
...
@@ -51,8 +51,8 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -51,8 +51,8 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$sql
=
"INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"
;
$sql
=
"INSERT INTO write_table (test_int, test_string) VALUES (?, ?)"
;
$affected
=
$this
->
_conn
->
executeUpdate
(
$affected
=
$this
->
_conn
->
executeUpdate
(
$sql
,
$sql
,
array
(
1
,
'foo'
)
,
[
1
,
'foo'
]
,
array
(
ParameterType
::
INTEGER
,
ParameterType
::
STRING
)
[
ParameterType
::
INTEGER
,
ParameterType
::
STRING
]
);
);
self
::
assertEquals
(
1
,
$affected
,
"executeUpdate() should return the number of affected rows!"
);
self
::
assertEquals
(
1
,
$affected
,
"executeUpdate() should return the number of affected rows!"
);
...
@@ -76,7 +76,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -76,7 +76,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$stmt
=
$this
->
_conn
->
prepare
(
$sql
);
$stmt
->
bindValue
(
1
,
1
,
ParameterType
::
INTEGER
);
$stmt
->
bindValue
(
1
,
1
,
ParameterType
::
INTEGER
);
$stmt
->
bindValue
(
2
,
"foo"
,
ParameterType
::
STRING
);
$stmt
->
bindValue
(
2
,
'foo'
,
ParameterType
::
STRING
);
$stmt
->
execute
();
$stmt
->
execute
();
self
::
assertEquals
(
1
,
$stmt
->
rowCount
());
self
::
assertEquals
(
1
,
$stmt
->
rowCount
());
...
...
tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php
View file @
be4253f5
...
@@ -874,7 +874,10 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
...
@@ -874,7 +874,10 @@ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase
$qb
->
where
(
'is_active = :isActive'
);
$qb
->
where
(
'is_active = :isActive'
);
$qb
->
setParameter
(
'isActive'
,
true
,
ParameterType
::
BOOLEAN
);
$qb
->
setParameter
(
'isActive'
,
true
,
ParameterType
::
BOOLEAN
);
self
::
assertSame
(
array
(
'name'
=>
ParameterType
::
STRING
,
'isActive'
=>
ParameterType
::
BOOLEAN
),
$qb
->
getParameterTypes
());
self
::
assertSame
([
'name'
=>
ParameterType
::
STRING
,
'isActive'
=>
ParameterType
::
BOOLEAN
,
],
$qb
->
getParameterTypes
());
}
}
/**
/**
...
...
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