aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/DB
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-06-30 16:56:59 +0200
committerRobin Appelman <robin@icewind.nl>2025-07-01 22:45:52 +0200
commitaa15f9d16d5b46d04763c7deedb129990e819364 (patch)
tree758e0aebcac34a545f9a21806120a9fcb96f4cb6 /tests/lib/DB
parent1620a0c0510a42b1da0a66488838f1ce3ba1210d (diff)
downloadnextcloud-server-rector-phpunit10.tar.gz
nextcloud-server-rector-phpunit10.zip
chore: run rectorrector-phpunit10
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/DB')
-rw-r--r--tests/lib/DB/ConnectionFactoryTest.php2
-rw-r--r--tests/lib/DB/Exception/DbalExceptionTest.php2
-rw-r--r--tests/lib/DB/MigrationsTest.php2
-rw-r--r--tests/lib/DB/MigratorTest.php2
-rw-r--r--tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php6
-rw-r--r--tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php28
-rw-r--r--tests/lib/DB/QueryBuilder/FunctionBuilderTest.php14
-rw-r--r--tests/lib/DB/QueryBuilder/Partitioned/JoinConditionTest.php8
-rw-r--r--tests/lib/DB/QueryBuilder/QueryBuilderTest.php56
-rw-r--r--tests/lib/DB/QueryBuilder/QuoteHelperTest.php4
10 files changed, 57 insertions, 67 deletions
diff --git a/tests/lib/DB/ConnectionFactoryTest.php b/tests/lib/DB/ConnectionFactoryTest.php
index fe744cf1791..d09a83ca856 100644
--- a/tests/lib/DB/ConnectionFactoryTest.php
+++ b/tests/lib/DB/ConnectionFactoryTest.php
@@ -28,10 +28,10 @@ class ConnectionFactoryTest extends TestCase {
}
/**
- * @dataProvider splitHostFromPortAndSocketData
* @param string $host
* @param array $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('splitHostFromPortAndSocketData')]
public function testSplitHostFromPortAndSocket($host, array $expected): void {
/** @var SystemConfig $config */
$config = $this->createMock(SystemConfig::class);
diff --git a/tests/lib/DB/Exception/DbalExceptionTest.php b/tests/lib/DB/Exception/DbalExceptionTest.php
index c37e65aea0e..eac74291749 100644
--- a/tests/lib/DB/Exception/DbalExceptionTest.php
+++ b/tests/lib/DB/Exception/DbalExceptionTest.php
@@ -35,10 +35,10 @@ class DbalExceptionTest extends \Test\TestCase {
}
/**
- * @dataProvider dataDriverException
* @param string $class
* @param int $reason
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataDriverException')]
public function testDriverException(string $class, int $reason): void {
$result = DbalException::wrap(new $class($this->driverException, null));
$this->assertSame($reason, $result->getReason());
diff --git a/tests/lib/DB/MigrationsTest.php b/tests/lib/DB/MigrationsTest.php
index 1841be42c04..2b39b26d852 100644
--- a/tests/lib/DB/MigrationsTest.php
+++ b/tests/lib/DB/MigrationsTest.php
@@ -185,10 +185,10 @@ class MigrationsTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGetMigration
* @param string $alias
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetMigration')]
public function testGetMigration($alias, $expected): void {
$this->migrationService = $this->getMockBuilder(MigrationService::class)
->onlyMethods(['getMigratedVersions', 'findMigrations'])
diff --git a/tests/lib/DB/MigratorTest.php b/tests/lib/DB/MigratorTest.php
index 26b0e000cf6..9d8ee6791a9 100644
--- a/tests/lib/DB/MigratorTest.php
+++ b/tests/lib/DB/MigratorTest.php
@@ -279,13 +279,13 @@ class MigratorTest extends \Test\TestCase {
}
/**
- * @dataProvider dataNotNullEmptyValuesFailOracle
*
* @param int $parameterType
* @param bool|int|string $value
* @param string $columnType
* @param bool $oracleThrows
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataNotNullEmptyValuesFailOracle')]
public function testNotNullEmptyValuesFailOracle(int $parameterType, $value, string $columnType, bool $oracleThrows): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
index 23e16258ea7..153993f396e 100644
--- a/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
+++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php
@@ -20,7 +20,7 @@ use Test\TestCase;
* @group DB
*/
class ExpressionBuilderDBTest extends TestCase {
- /** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */
+ /** @var \Doctrine\DBAL\Connection|IDBConnection */
protected $connection;
protected $schemaSetup = false;
@@ -48,12 +48,12 @@ class ExpressionBuilderDBTest extends TestCase {
}
/**
- * @dataProvider likeProvider
*
* @param string $param1
* @param string $param2
* @param boolean $match
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('likeProvider')]
public function testLike($param1, $param2, $match): void {
$query = $this->connection->getQueryBuilder();
@@ -85,12 +85,12 @@ class ExpressionBuilderDBTest extends TestCase {
}
/**
- * @dataProvider ilikeProvider
*
* @param string $param1
* @param string $param2
* @param boolean $match
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('ilikeProvider')]
public function testILike($param1, $param2, $match): void {
$query = $this->connection->getQueryBuilder();
diff --git a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
index 220a1430873..1f84ebfbec1 100644
--- a/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/ExpressionBuilderTest.php
@@ -30,7 +30,7 @@ class ExpressionBuilderTest extends TestCase {
/** @var DoctrineExpressionBuilder */
protected $doctrineExpressionBuilder;
- /** @var \OCP\IDBConnection */
+ /** @var IDBConnection */
protected $connection;
/** @var \Doctrine\DBAL\Connection */
@@ -67,7 +67,6 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparison
*
* @param string $comparison
* @param mixed $input1
@@ -75,6 +74,7 @@ class ExpressionBuilderTest extends TestCase {
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparison')]
public function testComparison($comparison, $input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -95,13 +95,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -113,13 +113,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testNotEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -131,13 +131,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testLowerThan($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -149,13 +149,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testLowerThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -167,13 +167,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testGreaterThan($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -185,13 +185,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataComparisons
*
* @param mixed $input1
* @param bool $isInput1Literal
* @param mixed $input2
* @param bool $isInput2Literal
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataComparisons')]
public function testGreaterThanEquals($input1, $isInput1Literal, $input2, $isInput2Literal): void {
[$doctrineInput1, $ocInput1] = $this->helpWithLiteral($input1, $isInput1Literal);
[$doctrineInput2, $ocInput2] = $this->helpWithLiteral($input2, $isInput2Literal);
@@ -224,11 +224,11 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataLike
*
* @param mixed $input
* @param bool $isLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataLike')]
public function testLike($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
@@ -239,11 +239,11 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataLike
*
* @param mixed $input
* @param bool $isLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataLike')]
public function testNotLike($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
@@ -263,11 +263,11 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataIn
*
* @param mixed $input
* @param bool $isLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataIn')]
public function testIn($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
@@ -278,11 +278,11 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataIn
*
* @param mixed $input
* @param bool $isLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataIn')]
public function testNotIn($input, $isLiteral): void {
[$doctrineInput, $ocInput] = $this->helpWithLiteral($input, $isLiteral);
@@ -332,11 +332,11 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataLiteral
*
* @param mixed $input
* @param string|null $type
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataLiteral')]
public function testLiteral($input, $type): void {
/** @var \OC\DB\QueryBuilder\Literal $actual */
$actual = $this->expressionBuilder->literal($input, $type);
@@ -376,13 +376,13 @@ class ExpressionBuilderTest extends TestCase {
}
/**
- * @dataProvider dataClobComparisons
* @param string $function
* @param mixed $value
* @param mixed $type
* @param bool $compareKeyToValue
* @param int $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataClobComparisons')]
public function testClobComparisons($function, $value, $type, $compareKeyToValue, $expected): void {
$appId = $this->getUniqueID('testing');
$this->createConfig($appId, 1, 4);
diff --git a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
index 9506b74ce7b..fc20af8a841 100644
--- a/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/FunctionBuilderTest.php
@@ -21,7 +21,7 @@ use Test\TestCase;
* @package Test\DB\QueryBuilder
*/
class FunctionBuilderTest extends TestCase {
- /** @var \Doctrine\DBAL\Connection|\OCP\IDBConnection */
+ /** @var \Doctrine\DBAL\Connection|IDBConnection */
protected $connection;
protected function setUp(): void {
@@ -30,9 +30,7 @@ class FunctionBuilderTest extends TestCase {
$this->connection = Server::get(IDBConnection::class);
}
- /**
- * @dataProvider providerTestConcatString
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTestConcatString')]
public function testConcatString($closure): void {
$query = $this->connection->getQueryBuilder();
[$real, $arguments, $return] = $closure($query);
@@ -335,9 +333,7 @@ class FunctionBuilderTest extends TestCase {
];
}
- /**
- * @dataProvider octetLengthProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('octetLengthProvider')]
public function testOctetLength(string $str, int $bytes): void {
$query = $this->connection->getQueryBuilder();
@@ -360,9 +356,7 @@ class FunctionBuilderTest extends TestCase {
];
}
- /**
- * @dataProvider charLengthProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('charLengthProvider')]
public function testCharLength(string $str, int $bytes): void {
$query = $this->connection->getQueryBuilder();
diff --git a/tests/lib/DB/QueryBuilder/Partitioned/JoinConditionTest.php b/tests/lib/DB/QueryBuilder/Partitioned/JoinConditionTest.php
index 3d34ad389bc..8f84d6a0d2c 100644
--- a/tests/lib/DB/QueryBuilder/Partitioned/JoinConditionTest.php
+++ b/tests/lib/DB/QueryBuilder/Partitioned/JoinConditionTest.php
@@ -41,9 +41,7 @@ class JoinConditionTest extends TestCase {
);
}
- /**
- * @dataProvider platformProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('platformProvider')]
public function testParseCondition(string $platform): void {
$query = $this->getBuilder($platform);
$param1 = $query->createNamedParameter('files');
@@ -63,9 +61,7 @@ class JoinConditionTest extends TestCase {
], $parsed->toConditions);
}
- /**
- * @dataProvider platformProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('platformProvider')]
public function testParseCastCondition(string $platform): void {
$query = $this->getBuilder($platform);
diff --git a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
index 538ec637099..990191a9ff5 100644
--- a/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
+++ b/tests/lib/DB/QueryBuilder/QueryBuilderTest.php
@@ -100,11 +100,11 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataFirstResult
*
* @param int|null $firstResult
* @param array $expectedSet
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataFirstResult')]
public function testFirstResult($firstResult, $expectedSet): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -137,11 +137,11 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataMaxResults
*
* @param int $maxResult
* @param array $expectedSet
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataMaxResults')]
public function testMaxResults($maxResult, $expectedSet): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -189,12 +189,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataSelect
*
* @param array $selectArguments
* @param array $expected
* @param string $expectedLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSelect')]
public function testSelect($selectArguments, $expected, $expectedLiteral = ''): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -242,12 +242,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataSelectAlias
*
* @param mixed $select
* @param array $alias
* @param array $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSelectAlias')]
public function testSelectAlias($select, $alias, $expected): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -366,12 +366,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataAddSelect
*
* @param array $selectArguments
* @param array $expected
* @param string $expectedLiteral
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAddSelect')]
public function testAddSelect($selectArguments, $expected, $expectedLiteral = ''): void {
$this->deleteTestingRows();
$this->createTestingRows();
@@ -418,13 +418,13 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataDelete
*
* @param string $tableName
* @param string $tableAlias
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataDelete')]
public function testDelete($tableName, $tableAlias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->delete($tableName, $tableAlias);
@@ -447,13 +447,13 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataUpdate
*
* @param string $tableName
* @param string $tableAlias
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataUpdate')]
public function testUpdate($tableName, $tableAlias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->update($tableName, $tableAlias);
@@ -475,12 +475,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataInsert
*
* @param string $tableName
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataInsert')]
public function testInsert($tableName, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert($tableName);
@@ -517,7 +517,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataFrom
*
* @param string|IQueryFunction $table1Name
* @param string $table1Alias
@@ -526,6 +525,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataFrom')]
public function testFrom($table1Name, $table1Alias, $table2Name, $table2Alias, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from($table1Name, $table1Alias);
if ($table2Name !== null) {
@@ -565,7 +565,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataJoin
*
* @param string $fromAlias
* @param string $tableName
@@ -574,6 +573,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataJoin')]
public function testJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->join(
@@ -595,7 +595,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataJoin
*
* @param string $fromAlias
* @param string $tableName
@@ -604,6 +603,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataJoin')]
public function testInnerJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->innerJoin(
@@ -645,7 +645,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataLeftJoin
*
* @param string $fromAlias
* @param string $tableName
@@ -654,6 +653,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataLeftJoin')]
public function testLeftJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->leftJoin(
@@ -695,7 +695,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataRightJoin
*
* @param string $fromAlias
* @param string $tableName
@@ -704,6 +703,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataRightJoin')]
public function testRightJoin($fromAlias, $tableName, $tableAlias, $condition, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->from('data1', 'd1');
$this->queryBuilder->rightJoin(
@@ -734,7 +734,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataSet
*
* @param string $partOne1
* @param string $partOne2
@@ -743,6 +742,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSet')]
public function testSet($partOne1, $partOne2, $partTwo1, $partTwo2, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->update('data');
$this->queryBuilder->set($partOne1, $partOne2);
@@ -769,12 +769,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataWhere
*
* @param array $whereArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataWhere')]
public function testWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
@@ -794,12 +794,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataWhere
*
* @param array $whereArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataWhere')]
public function testAndWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
@@ -826,12 +826,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataOrWhere
*
* @param array $whereArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataOrWhere')]
public function testOrWhere($whereArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
@@ -858,12 +858,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGroupBy
*
* @param array $groupByArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGroupBy')]
public function testGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
call_user_func_array(
@@ -890,12 +890,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataAddGroupBy
*
* @param array $groupByArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAddGroupBy')]
public function testAddGroupBy($groupByArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->select('column');
$this->queryBuilder->groupBy('column1');
@@ -922,13 +922,13 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataSetValue
*
* @param string $column
* @param string $value
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetValue')]
public function testSetValue($column, $value, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert('data');
$this->queryBuilder->setValue($column, $value);
@@ -945,13 +945,13 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataSetValue
*
* @param string $column
* @param string $value
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetValue')]
public function testValues($column, $value, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->insert('data');
$this->queryBuilder->values([
@@ -987,12 +987,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataHaving
*
* @param array $havingArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataHaving')]
public function testHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
call_user_func_array(
[$this->queryBuilder, 'having'],
@@ -1028,12 +1028,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataAndHaving
*
* @param array $havingArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAndHaving')]
public function testAndHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->having('condition1');
call_user_func_array(
@@ -1070,12 +1070,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataOrHaving
*
* @param array $havingArguments
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataOrHaving')]
public function testOrHaving($havingArguments, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->having('condition1');
call_user_func_array(
@@ -1103,13 +1103,13 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataOrderBy
*
* @param string $sort
* @param string $order
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataOrderBy')]
public function testOrderBy($sort, $order, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->orderBy($sort, $order);
@@ -1139,7 +1139,6 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataAddOrderBy
*
* @param string $sort2
* @param string $order2
@@ -1147,6 +1146,7 @@ class QueryBuilderTest extends \Test\TestCase {
* @param array $expectedQueryPart
* @param string $expectedQuery
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataAddOrderBy')]
public function testAddOrderBy($sort2, $order2, $order1, $expectedQueryPart, $expectedQuery): void {
$this->queryBuilder->orderBy('column1', $order1);
$this->queryBuilder->addOrderBy($sort2, $order2);
@@ -1219,12 +1219,12 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGetTableName
*
* @param string|IQueryFunction $tableName
* @param bool $automatic
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetTableName')]
public function testGetTableName($tableName, $automatic, $expected): void {
if ($automatic !== null) {
$this->queryBuilder->automaticTablePrefix($automatic);
@@ -1244,11 +1244,11 @@ class QueryBuilderTest extends \Test\TestCase {
}
/**
- * @dataProvider dataGetColumnName
* @param string $column
* @param string $prefix
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetColumnName')]
public function testGetColumnName($column, $prefix, $expected): void {
$this->assertSame(
$expected,
diff --git a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
index 3238306de82..6efb55708a1 100644
--- a/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
+++ b/tests/lib/DB/QueryBuilder/QuoteHelperTest.php
@@ -38,10 +38,10 @@ class QuoteHelperTest extends \Test\TestCase {
}
/**
- * @dataProvider dataQuoteColumnName
* @param mixed $input
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataQuoteColumnName')]
public function testQuoteColumnName($input, $expected): void {
$this->assertSame(
$expected,
@@ -73,10 +73,10 @@ class QuoteHelperTest extends \Test\TestCase {
}
/**
- * @dataProvider dataQuoteColumnNames
* @param mixed $input
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataQuoteColumnNames')]
public function testQuoteColumnNames($input, $expected): void {
$this->assertSame(
$expected,