Skip to content

Commit

Permalink
Bump doctrine/dbal from 3.0.0 to 3.1.3
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Oct 21, 2021
1 parent bdf44c7 commit 364b8d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 3rdparty
Submodule 3rdparty updated 198 files
4 changes: 2 additions & 2 deletions lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ public function setFirstResult($firstResult) {

/**
* Gets the position of the first result the query object was set to retrieve (the "offset").
* Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder.
* Returns 0 if {@link setFirstResult} was not applied to this QueryBuilder.
*
* @return integer The position of the first result.
* @return int The position of the first result.
*/
public function getFirstResult() {
return $this->queryBuilder->getFirstResult();
Expand Down
4 changes: 2 additions & 2 deletions lib/public/DB/QueryBuilder/IQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ public function setFirstResult($firstResult);

/**
* Gets the position of the first result the query object was set to retrieve (the "offset").
* Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder.
* Returns 0 if {@link setFirstResult} was not applied to this QueryBuilder.
*
* @return integer The position of the first result.
* @return int The position of the first result.
* @since 8.2.0
*/
public function getFirstResult();
Expand Down
10 changes: 3 additions & 7 deletions tests/lib/DB/QueryBuilder/QueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function deleteTestingRows($appId = 'testFirstResult') {

public function dataFirstResult() {
return [
[null, [99, 98, 97, 96, 95, 94, 93, 92, 91]],
[0, [99, 98, 97, 96, 95, 94, 93, 92, 91]],
[0, [99, 98, 97, 96, 95, 94, 93, 92, 91]],
[1, [98, 97, 96, 95, 94, 93, 92, 91]],
[5, [94, 93, 92, 91]],
Expand All @@ -112,7 +112,7 @@ public function dataFirstResult() {
/**
* @dataProvider dataFirstResult
*
* @param int $firstResult
* @param int|null $firstResult
* @param array $expectedSet
*/
public function testFirstResult($firstResult, $expectedSet) {
Expand All @@ -121,14 +121,10 @@ public function testFirstResult($firstResult, $expectedSet) {

if ($firstResult !== null) {
$this->queryBuilder->setFirstResult($firstResult);

// FIXME Remove this once Doctrine/DBAL is >2.5.1:
// FIXME See https://github.com/doctrine/dbal/pull/782
$this->queryBuilder->setMaxResults(100);
}

$this->assertSame(
$firstResult,
$firstResult ?? 0,
$this->queryBuilder->getFirstResult()
);

Expand Down

0 comments on commit 364b8d8

Please sign in to comment.