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
a92fa151
Unverified
Commit
a92fa151
authored
Jan 25, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual coding style fixes
parent
5e0eeef8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
32 deletions
+41
-32
ConnectionTest.php
tests/Doctrine/Tests/DBAL/ConnectionTest.php
+1
-1
MysqliConnectionTest.php
...octrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php
+2
-2
StatementIteratorTest.php
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php
+3
-0
FetchClass.php
.../Doctrine/Tests/DBAL/Functional/DataAccess/FetchClass.php
+17
-0
DataAccessTest.php
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
+7
-18
ResultCacheTest.php
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
+3
-3
QueryBuilderTest.php
tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php
+3
-3
DumperTest.php
tests/Doctrine/Tests/DBAL/Tools/DumperTest.php
+5
-5
No files found.
tests/Doctrine/Tests/DBAL/ConnectionTest.php
View file @
a92fa151
...
...
@@ -146,7 +146,7 @@ class ConnectionTest extends DbalTestCase
{
$eventManager
=
new
EventManager
();
/** @var AbstractPlatform|MockObject $
driver
*/
/** @var AbstractPlatform|MockObject $
platform
*/
$platform
=
$this
->
createMock
(
AbstractPlatform
::
class
);
$platform
->
expects
(
$this
->
once
())
->
method
(
'setEventManager'
)
...
...
tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php
View file @
a92fa151
...
...
@@ -34,7 +34,7 @@ class MysqliConnectionTest extends DbalFunctionalTestCase
$handler
=
static
function
()
:
bool
{
self
::
fail
(
'Never expected this to be called'
);
};
$default_handler
=
set_error_handler
(
$handler
);
set_error_handler
(
$handler
);
try
{
new
MysqliConnection
([
'host'
=>
'255.255.255.255'
],
'user'
,
'pass'
);
...
...
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php
View file @
a92fa151
...
...
@@ -39,6 +39,9 @@ class StatementIteratorTest extends DbalTestCase
});
}
/**
* @param Traversable<mixed> $iterator
*/
private
function
assertIterationCallsFetchOncePerStep
(
Traversable
$iterator
,
int
&
$calls
)
:
void
{
foreach
(
$iterator
as
$i
=>
$_
)
{
...
...
tests/Doctrine/Tests/DBAL/Functional/DataAccess/FetchClass.php
0 → 100644
View file @
a92fa151
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\Tests\DBAL\Functional\DataAccess
;
class
FetchClass
{
/** @var int */
public
$test_int
;
/** @var string */
public
$test_string
;
/** @var string */
public
$test_datetime
;
}
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
View file @
a92fa151
...
...
@@ -20,6 +20,7 @@ use Doctrine\DBAL\Platforms\TrimMode;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Statement
;
use
Doctrine\DBAL\Types\Types
;
use
Doctrine\Tests\DBAL\Functional\DataAccess\FetchClass
;
use
Doctrine\Tests\DbalFunctionalTestCase
;
use
InvalidArgumentException
;
use
PDO
;
...
...
@@ -1106,11 +1107,11 @@ class DataAccessTest extends DbalFunctionalTestCase
$results
=
$stmt
->
fetchAll
(
FetchMode
::
CUSTOM_OBJECT
,
My
FetchClass
::
class
FetchClass
::
class
);
self
::
assertCount
(
1
,
$results
);
self
::
assertInstanceOf
(
My
FetchClass
::
class
,
$results
[
0
]);
self
::
assertInstanceOf
(
FetchClass
::
class
,
$results
[
0
]);
self
::
assertEquals
(
1
,
$results
[
0
]
->
test_int
);
self
::
assertEquals
(
'foo'
,
$results
[
0
]
->
test_string
);
...
...
@@ -1144,12 +1145,12 @@ class DataAccessTest extends DbalFunctionalTestCase
$sql
=
'SELECT * FROM fetch_table'
;
$stmt
=
$this
->
connection
->
query
(
$sql
);
$stmt
->
setFetchMode
(
FetchMode
::
CUSTOM_OBJECT
,
My
FetchClass
::
class
);
$stmt
->
setFetchMode
(
FetchMode
::
CUSTOM_OBJECT
,
FetchClass
::
class
);
$results
=
$stmt
->
fetchAll
();
self
::
assertCount
(
1
,
$results
);
self
::
assertInstanceOf
(
My
FetchClass
::
class
,
$results
[
0
]);
self
::
assertInstanceOf
(
FetchClass
::
class
,
$results
[
0
]);
self
::
assertEquals
(
1
,
$results
[
0
]
->
test_int
);
self
::
assertEquals
(
'foo'
,
$results
[
0
]
->
test_string
);
...
...
@@ -1166,7 +1167,7 @@ class DataAccessTest extends DbalFunctionalTestCase
$sql
=
'SELECT * FROM fetch_table'
;
$stmt
=
$this
->
connection
->
query
(
$sql
);
$stmt
->
setFetchMode
(
FetchMode
::
CUSTOM_OBJECT
,
My
FetchClass
::
class
);
$stmt
->
setFetchMode
(
FetchMode
::
CUSTOM_OBJECT
,
FetchClass
::
class
);
$results
=
[];
while
(
$row
=
$stmt
->
fetch
())
{
...
...
@@ -1174,7 +1175,7 @@ class DataAccessTest extends DbalFunctionalTestCase
}
self
::
assertCount
(
1
,
$results
);
self
::
assertInstanceOf
(
My
FetchClass
::
class
,
$results
[
0
]);
self
::
assertInstanceOf
(
FetchClass
::
class
,
$results
[
0
]);
self
::
assertEquals
(
1
,
$results
[
0
]
->
test_int
);
self
::
assertEquals
(
'foo'
,
$results
[
0
]
->
test_string
);
...
...
@@ -1278,15 +1279,3 @@ class DataAccessTest extends DbalFunctionalTestCase
$connection
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_CASE
,
PDO
::
CASE_LOWER
);
}
}
class
MyFetchClass
{
/** @var int */
public
$test_int
;
/** @var string */
public
$test_string
;
/** @var string */
public
$test_datetime
;
}
tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php
View file @
a92fa151
...
...
@@ -126,9 +126,9 @@ class ResultCacheTest extends DbalFunctionalTestCase
$data
=
$this
->
hydrateStmt
(
$stmt
,
$fetchMode
);
$stmt
=
$this
->
connection
->
executeQuery
(
'SELECT * FROM caching ORDER BY test_int ASC'
,
[],
[],
new
QueryCacheProfile
(
10
,
'testcachekey'
));
$
data_
iterator
=
$this
->
hydrateStmtIterator
(
$stmt
,
$fetchMode
);
$iterator
=
$this
->
hydrateStmtIterator
(
$stmt
,
$fetchMode
);
self
::
assertEquals
(
$data
,
$
data_
iterator
);
self
::
assertEquals
(
$data
,
$iterator
);
}
public
function
testDontCloseNoCache
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php
View file @
a92fa151
...
...
@@ -667,13 +667,13 @@ class QueryBuilderTest extends DbalTestCase
$qb
->
setParameter
(
':test'
,
(
object
)
1
);
$
qb_
clone
=
clone
$qb
;
$clone
=
clone
$qb
;
self
::
assertEquals
((
string
)
$qb
,
(
string
)
$
qb_
clone
);
self
::
assertEquals
((
string
)
$qb
,
(
string
)
$clone
);
$qb
->
andWhere
(
'u.id = 1'
);
self
::
assertNotSame
(
$qb
->
getParameters
(),
$
qb_
clone
->
getParameters
());
self
::
assertNotSame
(
$qb
->
getParameters
(),
$clone
->
getParameters
());
}
public
function
testSimpleSelectWithoutTableAlias
()
:
void
...
...
tests/Doctrine/Tests/DBAL/Tools/DumperTest.php
View file @
a92fa151
...
...
@@ -97,13 +97,13 @@ class DumperTest extends DbalTestCase
*/
public
function
testExportParentAttributes
(
TestAsset\ParentClass
$class
,
array
$expected
)
:
void
{
$print
_r_c
lass
=
print_r
(
$class
,
true
);
$print
_r_e
xpected
=
print_r
(
$expected
,
true
);
$print
edC
lass
=
print_r
(
$class
,
true
);
$print
edE
xpected
=
print_r
(
$expected
,
true
);
$print
_r_class
=
substr
(
$print_r_class
,
(
int
)
strpos
(
$print_r_c
lass
,
'('
));
$print
_r_expected
=
substr
(
$print_r_expected
,
(
int
)
strpos
(
$print_r_e
xpected
,
'('
));
$print
edClass
=
substr
(
$printedClass
,
(
int
)
strpos
(
$printedC
lass
,
'('
));
$print
edExpected
=
substr
(
$printedExpected
,
(
int
)
strpos
(
$printedE
xpected
,
'('
));
self
::
assertSame
(
$print
_r_class
,
$print_r_e
xpected
);
self
::
assertSame
(
$print
edClass
,
$printedE
xpected
);
$var
=
Dumper
::
export
(
$class
,
3
);
$var
=
(
array
)
$var
;
...
...
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