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
2d6967f0
Unverified
Commit
2d6967f0
authored
Jul 10, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $conn->query()->fetch*() with $conn->fetch*()
parent
5ceeed8c
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
22 deletions
+21
-22
BlobTest.php
tests/Functional/BlobTest.php
+1
-1
DataAccessTest.php
tests/Functional/DataAccessTest.php
+1
-1
ConnectionTest.php
tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
+1
-2
DateExpressionTest.php
tests/Functional/Platform/DateExpressionTest.php
+1
-1
DefaultExpressionTest.php
tests/Functional/Platform/DefaultExpressionTest.php
+2
-2
PortabilityTest.php
tests/Functional/PortabilityTest.php
+1
-2
SchemaManagerFunctionalTestCase.php
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
+6
-6
SqliteSchemaManagerTest.php
tests/Functional/Schema/SqliteSchemaManagerTest.php
+3
-3
DBAL202Test.php
tests/Functional/Ticket/DBAL202Test.php
+2
-2
WriteTest.php
tests/Functional/WriteTest.php
+3
-2
No files found.
tests/Functional/BlobTest.php
View file @
2d6967f0
...
...
@@ -158,7 +158,7 @@ class BlobTest extends FunctionalTestCase
private
function
assertBlobContains
(
string
$text
)
:
void
{
$rows
=
$this
->
connection
->
query
(
'SELECT blobfield FROM blob_table'
)
->
fetchFirstColumn
(
);
$rows
=
$this
->
connection
->
fetchFirstColumn
(
'SELECT blobfield FROM blob_table'
);
self
::
assertCount
(
1
,
$rows
);
...
...
tests/Functional/DataAccessTest.php
View file @
2d6967f0
...
...
@@ -601,7 +601,7 @@ class DataAccessTest extends FunctionalTestCase
$this
->
connection
->
insert
(
'fetch_table'
,
[
'test_int'
=>
10
,
'test_string'
=>
'foo'
]);
$sql
=
'SELECT test_int FROM fetch_table'
;
$values
=
$this
->
connection
->
query
(
$sql
)
->
fetchFirstColumn
(
);
$values
=
$this
->
connection
->
fetchFirstColumn
(
$sql
);
self
::
assertEquals
([
1
,
10
],
$values
);
}
...
...
tests/Functional/Driver/PDO/PgSQL/ConnectionTest.php
View file @
2d6967f0
...
...
@@ -40,8 +40,7 @@ class ConnectionTest extends FunctionalTestCase
self
::
assertEquals
(
$charset
,
$connection
->
query
(
'SHOW client_encoding'
)
->
fetchOne
()
$connection
->
fetchOne
(
'SHOW client_encoding'
)
);
}
...
...
tests/Functional/Platform/DateExpressionTest.php
View file @
2d6967f0
...
...
@@ -27,7 +27,7 @@ class DateExpressionTest extends FunctionalTestCase
$platform
=
$this
->
connection
->
getDatabasePlatform
();
$sql
=
sprintf
(
'SELECT %s FROM date_expr_test'
,
$platform
->
getDateDiffExpression
(
'date1'
,
'date2'
));
$diff
=
$this
->
connection
->
query
(
$sql
)
->
fetchOne
(
);
$diff
=
$this
->
connection
->
fetchOne
(
$sql
);
self
::
assertEquals
(
$expected
,
$diff
);
}
...
...
tests/Functional/Platform/DefaultExpressionTest.php
View file @
2d6967f0
...
...
@@ -69,9 +69,9 @@ class DefaultExpressionTest extends FunctionalTestCase
)
);
[
$actualValue
,
$defaultValue
]
=
$this
->
connection
->
query
(
[
$actualValue
,
$defaultValue
]
=
$this
->
connection
->
fetchNumeric
(
'SELECT default_value, actual_value FROM default_expr_test'
)
->
fetchNumeric
()
;
);
self
::
assertEquals
(
$actualValue
,
$defaultValue
);
}
...
...
tests/Functional/PortabilityTest.php
View file @
2d6967f0
...
...
@@ -145,9 +145,8 @@ class PortabilityTest extends FunctionalTestCase
public
function
testFetchAllNullColumn
()
:
void
{
$
result
=
$this
->
connection
->
query
(
'SELECT Test_Null FROM portability_table'
);
$
column
=
$this
->
connection
->
fetchFirstColumn
(
'SELECT Test_Null FROM portability_table'
);
$column
=
$result
->
fetchFirstColumn
();
self
::
assertSame
([
null
,
null
],
$column
);
}
}
tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
2d6967f0
...
...
@@ -1440,17 +1440,17 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'1'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = \'1\''
);
$lastUsedIdBeforeDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdBeforeDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
"SELECT id FROM test_pk_auto_increment WHERE text = '1'"
);
$this
->
connection
->
query
(
'DELETE FROM test_pk_auto_increment'
);
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'2'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = \'2\''
);
$lastUsedIdAfterDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdAfterDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
"SELECT id FROM test_pk_auto_increment WHERE text = '2'"
);
self
::
assertGreaterThan
(
$lastUsedIdBeforeDelete
,
$lastUsedIdAfterDelete
);
}
...
...
tests/Functional/Schema/SqliteSchemaManagerTest.php
View file @
2d6967f0
...
...
@@ -238,9 +238,9 @@ SQL;
$this
->
connection
->
insert
(
'test_pk_auto_increment'
,
[
'text'
=>
'2'
]);
$
result
=
$this
->
connection
->
query
(
'SELECT id FROM test_pk_auto_increment WHERE text = "2"'
);
$lastUsedIdAfterDelete
=
(
int
)
$result
->
fetchOne
(
);
$
lastUsedIdAfterDelete
=
(
int
)
$this
->
connection
->
fetchOne
(
'SELECT id FROM test_pk_auto_increment WHERE text = "2"'
);
// with an empty table, non autoincrement rowid is always 1
self
::
assertEquals
(
1
,
$lastUsedIdAfterDelete
);
...
...
tests/Functional/Ticket/DBAL202Test.php
View file @
2d6967f0
...
...
@@ -36,7 +36,7 @@ class DBAL202Test extends FunctionalTestCase
$stmt
->
execute
();
$this
->
connection
->
rollBack
();
self
::
assertEquals
(
0
,
$this
->
connection
->
query
(
'SELECT COUNT(1) FROM DBAL202'
)
->
fetchOne
(
));
self
::
assertEquals
(
0
,
$this
->
connection
->
fetchOne
(
'SELECT COUNT(1) FROM DBAL202'
));
}
public
function
testStatementCommit
()
:
void
...
...
@@ -46,6 +46,6 @@ class DBAL202Test extends FunctionalTestCase
$stmt
->
execute
();
$this
->
connection
->
commit
();
self
::
assertEquals
(
1
,
$this
->
connection
->
query
(
'SELECT COUNT(1) FROM DBAL202'
)
->
fetchOne
(
));
self
::
assertEquals
(
1
,
$this
->
connection
->
fetchOne
(
'SELECT COUNT(1) FROM DBAL202'
));
}
}
tests/Functional/WriteTest.php
View file @
2d6967f0
...
...
@@ -174,8 +174,9 @@ class WriteTest extends FunctionalTestCase
return
strtolower
(
$sequence
->
getName
())
===
'write_table_id_seq'
;
}));
$result
=
$this
->
connection
->
query
(
$this
->
connection
->
getDatabasePlatform
()
->
getSequenceNextValSQL
(
'write_table_id_seq'
));
$nextSequenceVal
=
$result
->
fetchOne
();
$nextSequenceVal
=
$this
->
connection
->
fetchOne
(
$this
->
connection
->
getDatabasePlatform
()
->
getSequenceNextValSQL
(
'write_table_id_seq'
)
);
$lastInsertId
=
$this
->
lastInsertId
(
'write_table_id_seq'
);
...
...
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