Apply changes from master's update to 3.1.3

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-11-15 19:06:36 +01:00
parent 1362da82d5
commit 3709a8182a
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA
4 changed files with 8 additions and 12 deletions

View file

@ -462,9 +462,9 @@ class QueryBuilder implements IQueryBuilder {
/**
* 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();

View file

@ -83,7 +83,7 @@ class SqliteAutoincrement implements IRepairStep {
foreach ($columnNames as $columnName) {
$columnSchema = $tableSchema->getColumn($columnName);
$columnDiff = new ColumnDiff($columnSchema->getName(), $columnSchema);
$tableDiff->changedColumns[] = $columnDiff;
$tableDiff->changedColumns[$columnSchema->getName()] = $columnDiff;
$schemaDiff->changedTables[] = $tableDiff;
}
} catch (SchemaException $e) {

View file

@ -289,9 +289,9 @@ interface IQueryBuilder {
/**
* 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();

View file

@ -102,7 +102,7 @@ class QueryBuilderTest extends \Test\TestCase {
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]],
@ -112,7 +112,7 @@ class QueryBuilderTest extends \Test\TestCase {
/**
* @dataProvider dataFirstResult
*
* @param int $firstResult
* @param int|null $firstResult
* @param array $expectedSet
*/
public function testFirstResult($firstResult, $expectedSet) {
@ -121,14 +121,10 @@ class QueryBuilderTest extends \Test\TestCase {
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()
);