diff --git a/.gitattributes b/.gitattributes
index 91b0574a0..b70296d12 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3,7 +3,9 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
-/.php_cs.dist export-ignore
+/.php-cs-fixer.dist.php export-ignore
+/.phpcs.xml.dist export-ignore
+/.readthedocs.yaml export-ignore
/.scrutinizer.yml export-ignore
/CHANGELOG.PHPExcel.md export-ignore
/bin export-ignore
@@ -11,6 +13,8 @@
/docs export-ignore
/infra export-ignore
/mkdocs.yml export-ignore
+/phpstan-baseline.neon export-ignore
+/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/samples export-ignore
/tests export-ignore
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index c4711f12a..6348cc005 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -146,6 +146,7 @@ $config
'ordered_imports' => true,
'ordered_interfaces' => true,
'ordered_traits' => true,
+ 'php_unit_attributes' => ['keep_annotations' => false],
'php_unit_construct' => true,
'php_unit_dedicate_assert' => true,
'php_unit_dedicate_assert_internal_type' => true,
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8125f69e1..0b0bfe17b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,7 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org).
### Fixed
-- Nothing yet.
+- Html Reader/Writer Better Handling of Booleans. [PR #4257](https://github.com/PHPOffice/PhpSpreadsheet/pull/4257)
+- Fill Patterns/Colors When Xml Attributes are Missing. [Issue #4248](https://github.com/PHPOffice/PhpSpreadsheet/issues/4248) [PR #4250](https://github.com/PHPOffice/PhpSpreadsheet/pull/4250)
+- Remove Unneccesary files from Composer Package. [PR #4262](https://github.com/PHPOffice/PhpSpreadsheet/pull/4262)
+- Swapped row and column indexes in ReferenceHelper. [Issue #4246](https://github.com/PHPOffice/PhpSpreadsheet/issues/4246) [PR #4247](https://github.com/PHPOffice/PhpSpreadsheet/pull/4247)
+- Fix minor break handling drawings. [Issue #4241](https://github.com/PHPOffice/PhpSpreadsheet/issues/4241) [PR #4244](https://github.com/PHPOffice/PhpSpreadsheet/pull/4244)
+- Ignore cell formatting when the format is a single @. [Issue #4242](https://github.com/PHPOffice/PhpSpreadsheet/issues/4242) [PR #4243](https://github.com/PHPOffice/PhpSpreadsheet/pull/4243)
## 2024-11-22 - 3.5.0
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 209a9199e..709792031 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -40,7 +40,7 @@ This makes it easier to see exactly what is being tested when reviewing the PR.
2. Tag subject must be the version number, eg: `1.2.3`
3. Tag body must be a copy-paste of the changelog entries.
3. Push the tag with `git push --tags`, GitHub Actions will create a GitHub release automatically, and the release details will automatically be sent to packagist.
-4. By default, Github remove markdown headings in the Release Notes. You can either edit to restore these, or, probably preferably, change the default comment character on your system - `git config core.commentChar ';'`.
+4. By default, Github removes markdown headings in the Release Notes. You can either edit to restore these, or, probably preferably, change the default comment character on your system - `git config core.commentChar ";"`.
> **Note:** Tagged releases are made from the `master` branch. Only in an emergency should a tagged release be made from the `release` branch. (i.e. cherry-picked hot-fixes.) However, there are 3 branches which have been updated to apply security patches, and those may be tagged if future security updates are needed.
- release1291
diff --git a/composer.json b/composer.json
index 6acb8333c..7f1777676 100644
--- a/composer.json
+++ b/composer.json
@@ -95,7 +95,7 @@
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan-phpunit": "^1.0",
- "phpunit/phpunit": "^9.6 || ^10.5",
+ "phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.7",
"tecnickcom/tcpdf": "^6.5"
},
diff --git a/composer.lock b/composer.lock
index b217d08ce..6533b316a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "46a82d82209bfb130fa4a89d548fe2a0",
+ "content-hash": "f7caa2101e268445a358275ee83b90d9",
"packages": [
{
"name": "maennchen/zipstream-php",
@@ -1051,16 +1051,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
- "version": "v3.64.0",
+ "version": "v3.65.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
- "reference": "58dd9c931c785a79739310aef5178928305ffa67"
+ "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67",
- "reference": "58dd9c931c785a79739310aef5178928305ffa67",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
+ "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
"shasum": ""
},
"require": {
@@ -1070,7 +1070,7 @@
"ext-filter": "*",
"ext-json": "*",
"ext-tokenizer": "*",
- "fidry/cpu-core-counter": "^1.0",
+ "fidry/cpu-core-counter": "^1.2",
"php": "^7.4 || ^8.0",
"react/child-process": "^0.6.5",
"react/event-loop": "^1.0",
@@ -1090,18 +1090,18 @@
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
- "facile-it/paraunit": "^1.3 || ^2.3",
- "infection/infection": "^0.29.5",
- "justinrainbow/json-schema": "^5.2",
+ "facile-it/paraunit": "^1.3.1 || ^2.4",
+ "infection/infection": "^0.29.8",
+ "justinrainbow/json-schema": "^5.3 || ^6.0",
"keradus/cli-executor": "^2.1",
- "mikey179/vfsstream": "^1.6.11",
+ "mikey179/vfsstream": "^1.6.12",
"php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5",
- "phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2",
- "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
- "symfony/yaml": "^5.4 || ^6.0 || ^7.0"
+ "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3",
+ "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8",
+ "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
@@ -1142,7 +1142,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
- "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0"
+ "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0"
},
"funding": [
{
@@ -1150,7 +1150,7 @@
"type": "github"
}
],
- "time": "2024-08-30T23:09:38+00:00"
+ "time": "2024-11-25T00:39:24+00:00"
},
{
"name": "masterminds/html5",
@@ -1221,16 +1221,16 @@
},
{
"name": "mitoteam/jpgraph",
- "version": "10.4.1",
+ "version": "10.4.3",
"source": {
"type": "git",
"url": "https://github.com/mitoteam/jpgraph.git",
- "reference": "bf92f4e7b498412c8bb60b70eb7625041b1526d8"
+ "reference": "f0db97108aec23a3bbb34721365931af992b83b3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mitoteam/jpgraph/zipball/bf92f4e7b498412c8bb60b70eb7625041b1526d8",
- "reference": "bf92f4e7b498412c8bb60b70eb7625041b1526d8",
+ "url": "https://api.github.com/repos/mitoteam/jpgraph/zipball/f0db97108aec23a3bbb34721365931af992b83b3",
+ "reference": "f0db97108aec23a3bbb34721365931af992b83b3",
"shasum": ""
},
"require": {
@@ -1252,32 +1252,40 @@
],
"authors": [
{
- "name": "JpGraph team"
+ "name": "JpGraph team",
+ "homepage": "https://jpgraph.net",
+ "role": "Original Library Developers"
+ },
+ {
+ "name": "MiTo Team",
+ "email": "info@mito-team.com",
+ "homepage": "https://www.mito-team.com",
+ "role": "Composer package maintenance, PHP-compatibility patches"
}
],
- "description": "JpGraph library composer package with PHP 8.3 support",
+ "description": "JpGraph library composer package with PHP 8.4 support",
"homepage": "https://github.com/mitoteam/jpgraph",
"keywords": [
"jpgraph"
],
"support": {
"issues": "https://github.com/mitoteam/jpgraph/issues",
- "source": "https://github.com/mitoteam/jpgraph/tree/10.4.1"
+ "source": "https://github.com/mitoteam/jpgraph/tree/10.4.3"
},
- "time": "2024-01-29T10:59:20+00:00"
+ "time": "2024-12-01T06:36:31+00:00"
},
{
"name": "mpdf/mpdf",
- "version": "v8.2.4",
+ "version": "v8.2.5",
"source": {
"type": "git",
"url": "https://github.com/mpdf/mpdf.git",
- "reference": "9e3ff91606fed11cd58a130eabaaf60e56fdda88"
+ "reference": "e175b05e3e00977b85feb96a8cccb174ac63621f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/mpdf/mpdf/zipball/9e3ff91606fed11cd58a130eabaaf60e56fdda88",
- "reference": "9e3ff91606fed11cd58a130eabaaf60e56fdda88",
+ "url": "https://api.github.com/repos/mpdf/mpdf/zipball/e175b05e3e00977b85feb96a8cccb174ac63621f",
+ "reference": "e175b05e3e00977b85feb96a8cccb174ac63621f",
"shasum": ""
},
"require": {
@@ -1287,7 +1295,7 @@
"mpdf/psr-log-aware-trait": "^2.0 || ^3.0",
"myclabs/deep-copy": "^1.7",
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
- "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
+ "php": "^5.6 || ^7.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"psr/http-message": "^1.0 || ^2.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"setasign/fpdi": "^2.1"
@@ -1335,7 +1343,7 @@
"utf-8"
],
"support": {
- "docs": "http://mpdf.github.io",
+ "docs": "https://mpdf.github.io",
"issues": "https://github.com/mpdf/mpdf/issues",
"source": "https://github.com/mpdf/mpdf"
},
@@ -1345,7 +1353,7 @@
"type": "custom"
}
],
- "time": "2024-06-14T16:06:41+00:00"
+ "time": "2024-11-18T15:30:42+00:00"
},
{
"name": "mpdf/psr-http-message-shim",
@@ -2424,16 +2432,16 @@
},
{
"name": "psr/log",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
- "reference": "79dff0b268932c640297f5208d6298f71855c03e"
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e",
- "reference": "79dff0b268932c640297f5208d6298f71855c03e",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
+ "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
@@ -2468,9 +2476,9 @@
"psr-3"
],
"support": {
- "source": "https://github.com/php-fig/log/tree/3.0.1"
+ "source": "https://github.com/php-fig/log/tree/3.0.2"
},
- "time": "2024-08-21T13:31:24+00:00"
+ "time": "2024-09-11T13:17:53+00:00"
},
{
"name": "react/cache",
@@ -3985,16 +3993,16 @@
},
{
"name": "setasign/fpdi",
- "version": "v2.6.0",
+ "version": "v2.6.1",
"source": {
"type": "git",
"url": "https://github.com/Setasign/FPDI.git",
- "reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad"
+ "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6db878129ec6c7e141316ee71872923e7f1b7ad",
- "reference": "a6db878129ec6c7e141316ee71872923e7f1b7ad",
+ "url": "https://api.github.com/repos/Setasign/FPDI/zipball/09a816004fcee9ed3405bd164147e3fdbb79a56f",
+ "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f",
"shasum": ""
},
"require": {
@@ -4045,7 +4053,7 @@
],
"support": {
"issues": "https://github.com/Setasign/FPDI/issues",
- "source": "https://github.com/Setasign/FPDI/tree/v2.6.0"
+ "source": "https://github.com/Setasign/FPDI/tree/v2.6.1"
},
"funding": [
{
@@ -4053,20 +4061,20 @@
"type": "tidelift"
}
],
- "time": "2023-12-11T16:03:32+00:00"
+ "time": "2024-09-02T10:17:15+00:00"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.10.3",
+ "version": "3.11.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
+ "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
- "reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87",
+ "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87",
"shasum": ""
},
"require": {
@@ -4133,7 +4141,7 @@
"type": "open_collective"
}
],
- "time": "2024-09-18T10:38:58+00:00"
+ "time": "2024-11-16T12:02:36+00:00"
},
{
"name": "symfony/console",
diff --git a/docs/topics/recipes.md b/docs/topics/recipes.md
index b5a392703..8b27155d9 100644
--- a/docs/topics/recipes.md
+++ b/docs/topics/recipes.md
@@ -1293,8 +1293,8 @@ style object:
```php
$spreadsheet->getActiveSheet()
- ->duplicateStyle(
- $spreadsheet->getActiveSheet()->getStyle('B2'),
+ ->duplicateConditionalStyle(
+ $spreadsheet->getActiveSheet()->getConditionalStyles('B2'),
'B3:B7'
);
```
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 207d8ec97..d3e845c1e 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -3,6 +3,7 @@
+
./tests/PhpSpreadsheetTests
diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist
deleted file mode 100644
index 896b73339..000000000
--- a/phpunit9.xml.dist
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- ./src
-
-
-
-
-
-
-
- ./tests/PhpSpreadsheetTests
-
-
diff --git a/samples/Basic4/53_ImageOpacity.php b/samples/Basic4/53_ImageOpacity.php
index 75d22bae9..ec3916a9c 100644
--- a/samples/Basic4/53_ImageOpacity.php
+++ b/samples/Basic4/53_ImageOpacity.php
@@ -5,9 +5,6 @@ require __DIR__ . '/../Header.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
-//var_dump(realpath(__DIR__ . '/../images/blue_square.png'));
-//exit();
-
$path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'images/blue_square.png';
$spreadsheet = new Spreadsheet();
$spreadsheet->getProperties()->setTitle('53_ImageOpacity');
@@ -33,12 +30,12 @@ $drawing->setOpacity(80000);
$drawing->setWorksheet($sheet);
$drawing = new Drawing();
+$drawing->setWorksheet($sheet);
$drawing->setName('Blue Square opacity 60%');
$drawing->setPath($path);
$drawing->setCoordinates('E1');
$drawing->setCoordinates2('F5');
$drawing->setOpacity(60000);
-$drawing->setWorksheet($sheet);
$drawing = new Drawing();
$drawing->setName('Blue Square opacity 40%');
@@ -57,12 +54,12 @@ $drawing->setOpacity(20000);
$drawing->setWorksheet($sheet);
$drawing = new Drawing();
+$drawing->setWorksheet($sheet);
$drawing->setName('Blue Square opacity 0%');
$drawing->setPath($path);
$drawing->setCoordinates('E8');
$drawing->setCoordinates2('F12');
$drawing->setOpacity(0);
-$drawing->setWorksheet($sheet);
// Save
$helper->write($spreadsheet, __FILE__, ['Xlsx', 'Html', 'Dompdf', 'Mpdf']);
diff --git a/src/PhpSpreadsheet/Calculation/Calculation.php b/src/PhpSpreadsheet/Calculation/Calculation.php
index 0cc64c32e..ab52fb1af 100644
--- a/src/PhpSpreadsheet/Calculation/Calculation.php
+++ b/src/PhpSpreadsheet/Calculation/Calculation.php
@@ -3141,6 +3141,53 @@ class Calculation
return $localeFileName;
}
+ /** @var array> */
+ private static array $falseTrueArray = [];
+
+ /** @return array> */
+ public function getFalseTrueArray(): array
+ {
+ if (!empty(self::$falseTrueArray)) {
+ return self::$falseTrueArray;
+ }
+ if (count(self::$validLocaleLanguages) == 1) {
+ self::loadLocales();
+ }
+ $falseTrueArray = [['FALSE'], ['TRUE']];
+ foreach (self::$validLocaleLanguages as $language) {
+ if (str_starts_with($language, 'en')) {
+ continue;
+ }
+ $locale = $language;
+ if (str_contains($locale, '_')) {
+ [$language] = explode('_', $locale);
+ }
+ $localeDir = implode(DIRECTORY_SEPARATOR, [__DIR__, 'locale', null]);
+
+ try {
+ $functionNamesFile = $this->getLocaleFile($localeDir, $locale, $language, 'functions');
+ } catch (Exception $e) {
+ continue;
+ }
+ // Retrieve the list of locale or language specific function names
+ $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
+ foreach ($localeFunctions as $localeFunction) {
+ [$localeFunction] = explode('##', $localeFunction); // Strip out comments
+ if (str_contains($localeFunction, '=')) {
+ [$fName, $lfName] = array_map('trim', explode('=', $localeFunction));
+ if ($fName === 'FALSE') {
+ $falseTrueArray[0][] = $lfName;
+ } elseif ($fName === 'TRUE') {
+ $falseTrueArray[1][] = $lfName;
+ }
+ }
+ }
+ }
+ self::$falseTrueArray = $falseTrueArray;
+
+ return $falseTrueArray;
+ }
+
/**
* Set the locale code.
*
diff --git a/src/PhpSpreadsheet/Reader/Csv.php b/src/PhpSpreadsheet/Reader/Csv.php
index 33bee9cdf..89cbfd5ad 100644
--- a/src/PhpSpreadsheet/Reader/Csv.php
+++ b/src/PhpSpreadsheet/Reader/Csv.php
@@ -84,10 +84,13 @@ class Csv extends BaseReader
*/
private static $constructorCallback;
+ /** Will be changed to false in next major release */
+ public const DEFAULT_TEST_AUTODETECT = true;
+
/**
* Attempt autodetect line endings (deprecated after PHP8.1)?
*/
- private bool $testAutodetect = true;
+ private bool $testAutodetect = self::DEFAULT_TEST_AUTODETECT;
protected bool $castFormattedNumberToNumeric = false;
diff --git a/src/PhpSpreadsheet/Reader/Html.php b/src/PhpSpreadsheet/Reader/Html.php
index 4ca781a87..431a08fff 100644
--- a/src/PhpSpreadsheet/Reader/Html.php
+++ b/src/PhpSpreadsheet/Reader/Html.php
@@ -7,6 +7,7 @@ use DOMDocument;
use DOMElement;
use DOMNode;
use DOMText;
+use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Comment;
@@ -271,6 +272,12 @@ class Html extends BaseReader
->setQuotePrefix(true);
}
}
+ if ($datatype === DataType::TYPE_BOOL) {
+ $cellContent = self::convertBoolean($cellContent);
+ if (!is_bool($cellContent)) {
+ $attributeArray['data-type'] = DataType::TYPE_STRING;
+ }
+ }
//catching the Exception and ignoring the invalid data types
try {
@@ -291,6 +298,31 @@ class Html extends BaseReader
$cellContent = (string) '';
}
+ /** @var array> */
+ private static array $falseTrueArray = [];
+
+ private static function convertBoolean(?string $cellContent): bool|string
+ {
+ if ($cellContent === '1') {
+ return true;
+ }
+ if ($cellContent === '0' || $cellContent === '' || $cellContent === null) {
+ return false;
+ }
+ if (empty(self::$falseTrueArray)) {
+ $calc = Calculation::getInstance();
+ self::$falseTrueArray = $calc->getFalseTrueArray();
+ }
+ if (in_array(mb_strtoupper($cellContent), self::$falseTrueArray[1], true)) {
+ return true;
+ }
+ if (in_array(mb_strtoupper($cellContent), self::$falseTrueArray[0], true)) {
+ return false;
+ }
+
+ return $cellContent;
+ }
+
private function processDomElementBody(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child): void
{
$attributeArray = [];
diff --git a/src/PhpSpreadsheet/Reader/Xlsx/Styles.php b/src/PhpSpreadsheet/Reader/Xlsx/Styles.php
index 0672854ad..b02f3d3ff 100644
--- a/src/PhpSpreadsheet/Reader/Xlsx/Styles.php
+++ b/src/PhpSpreadsheet/Reader/Xlsx/Styles.php
@@ -149,14 +149,22 @@ class Styles extends BaseParserClass
$fillStyle->getStartColor()->setARGB($this->readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=0]'))->color)); //* @phpstan-ignore-line
$fillStyle->getEndColor()->setARGB($this->readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=1]'))->color)); //* @phpstan-ignore-line
} elseif ($fillStyleXml->patternFill) {
- $defaultFillStyle = Fill::FILL_NONE;
+ $defaultFillStyle = ($fillStyle->getFillType() !== null) ? Fill::FILL_NONE : '';
+ $fgFound = false;
+ $bgFound = false;
if ($fillStyleXml->patternFill->fgColor) {
$fillStyle->getStartColor()->setARGB($this->readColor($fillStyleXml->patternFill->fgColor, true));
- $defaultFillStyle = Fill::FILL_SOLID;
+ if ($fillStyle->getFillType() !== null) {
+ $defaultFillStyle = Fill::FILL_SOLID;
+ }
+ $fgFound = true;
}
if ($fillStyleXml->patternFill->bgColor) {
$fillStyle->getEndColor()->setARGB($this->readColor($fillStyleXml->patternFill->bgColor, true));
- $defaultFillStyle = Fill::FILL_SOLID;
+ if ($fillStyle->getFillType() !== null) {
+ $defaultFillStyle = Fill::FILL_SOLID;
+ }
+ $bgFound = true;
}
$type = '';
@@ -169,6 +177,22 @@ class Styles extends BaseParserClass
$patternType = ($type === '') ? $defaultFillStyle : $type;
$fillStyle->setFillType($patternType);
+ if (
+ !$fgFound // no foreground color specified
+ && !in_array($patternType, [Fill::FILL_NONE, Fill::FILL_SOLID], true) // these patterns aren't relevant
+ && $fillStyle->getStartColor()->getARGB() // not conditional
+ ) {
+ $fillStyle->getStartColor()
+ ->setARGB('', true);
+ }
+ if (
+ !$bgFound // no background color specified
+ && !in_array($patternType, [Fill::FILL_NONE, Fill::FILL_SOLID], true) // these patterns aren't relevant
+ && $fillStyle->getEndColor()->getARGB() // not conditional
+ ) {
+ $fillStyle->getEndColor()
+ ->setARGB('', true);
+ }
}
}
diff --git a/src/PhpSpreadsheet/ReferenceHelper.php b/src/PhpSpreadsheet/ReferenceHelper.php
index afcfa016e..dfcea10e4 100644
--- a/src/PhpSpreadsheet/ReferenceHelper.php
+++ b/src/PhpSpreadsheet/ReferenceHelper.php
@@ -1215,7 +1215,7 @@ class ReferenceHelper
if ($worksheet->cellExists($coordinate)) {
$xfIndex = $worksheet->getCell($coordinate)->getXfIndex();
for ($j = $beforeRow; $j <= $beforeRow - 1 + $numberOfRows; ++$j) {
- if (!empty($xfIndex) || $worksheet->cellExists([$j, $i])) {
+ if (!empty($xfIndex) || $worksheet->cellExists([$i, $j])) {
$worksheet->getCell(Coordinate::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
}
}
diff --git a/src/PhpSpreadsheet/Style/Color.php b/src/PhpSpreadsheet/Style/Color.php
index 6f9db8a21..8aa4734fc 100644
--- a/src/PhpSpreadsheet/Style/Color.php
+++ b/src/PhpSpreadsheet/Style/Color.php
@@ -230,12 +230,14 @@ class Color extends Supervisor
*
* @return $this
*/
- public function setARGB(?string $colorValue = self::COLOR_BLACK): static
+ public function setARGB(?string $colorValue = self::COLOR_BLACK, bool $nullStringOkay = false): static
{
$this->hasChanged = true;
- $colorValue = $this->validateColor($colorValue);
- if ($colorValue === '') {
- return $this;
+ if (!$nullStringOkay || $colorValue !== '') {
+ $colorValue = $this->validateColor($colorValue);
+ if ($colorValue === '') {
+ return $this;
+ }
}
if ($this->isSupervisor) {
diff --git a/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php b/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php
index 8ae33354a..cb15e8f37 100644
--- a/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php
+++ b/src/PhpSpreadsheet/Style/NumberFormat/Formatter.php
@@ -14,6 +14,7 @@ class Formatter extends BaseFormatter
* Matches any @ symbol that isn't enclosed in quotes.
*/
private const SYMBOL_AT = '/@(?=(?:[^"]*"[^"]*")*[^"]*\Z)/miu';
+ private const QUOTE_REPLACEMENT = "\u{fffe}"; // invalid Unicode character
/**
* Matches any ; symbol that isn't enclosed in quotes, for a "section" split.
@@ -125,8 +126,23 @@ class Formatter extends BaseFormatter
}
// For now we do not treat strings in sections, although section 4 of a format code affects strings
// Process a single block format code containing @ for text substitution
- if (preg_match(self::SECTION_SPLIT, $format) === 0 && preg_match(self::SYMBOL_AT, $format) === 1) {
- return str_replace('"', '', preg_replace(self::SYMBOL_AT, (string) $value, $format) ?? '');
+ $formatx = str_replace('\\"', self::QUOTE_REPLACEMENT, $format);
+ if (preg_match(self::SECTION_SPLIT, $format) === 0 && preg_match(self::SYMBOL_AT, $formatx) === 1) {
+ if (!str_contains($format, '"')) {
+ return str_replace('@', $value, $format);
+ }
+ //escape any dollar signs on the string, so they are not replaced with an empty value
+ $value = str_replace(
+ ['$', '"'],
+ ['\\$', self::QUOTE_REPLACEMENT],
+ (string) $value
+ );
+
+ return str_replace(
+ ['"', self::QUOTE_REPLACEMENT],
+ ['', '"'],
+ preg_replace(self::SYMBOL_AT, $value, $formatx) ?? $value
+ );
}
// If we have a text value, return it "as is"
diff --git a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
index 514cf1012..73bc7e906 100644
--- a/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
+++ b/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
@@ -360,7 +360,7 @@ class Column
public function __clone()
{
$vars = get_object_vars($this);
- /** @var AutoFilter\Column\Rule[] $value */
+ /** @var Column\Rule[] $value */
foreach ($vars as $key => $value) {
if ($key === 'parent') {
// Detach from autofilter parent
diff --git a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
index 326b8d6d2..135f5b216 100644
--- a/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
+++ b/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
@@ -197,15 +197,18 @@ class BaseDrawing implements IComparable
public function setWorksheet(?Worksheet $worksheet = null, bool $overrideOld = false): self
{
if ($this->worksheet === null) {
- // Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
- if ($worksheet !== null && !($this instanceof Drawing && $this->getPath() === '')) {
+ // Add drawing to Worksheet
+ if ($worksheet !== null) {
$this->worksheet = $worksheet;
- $this->worksheet->getCell($this->coordinates);
- $this->worksheet->getDrawingCollection()->append($this);
+ if (!($this instanceof Drawing && $this->getPath() === '')) {
+ $this->worksheet->getCell($this->coordinates);
+ }
+ $this->worksheet->getDrawingCollection()
+ ->append($this);
}
} else {
if ($overrideOld) {
- // Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
+ // Remove drawing from old Worksheet
$iterator = $this->worksheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
@@ -217,10 +220,10 @@ class BaseDrawing implements IComparable
}
}
- // Set new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
+ // Set new Worksheet
$this->setWorksheet($worksheet);
} else {
- throw new PhpSpreadsheetException('A Worksheet has already been assigned. Drawings can only exist on one \\PhpOffice\\PhpSpreadsheet\\Worksheet.');
+ throw new PhpSpreadsheetException('A Worksheet has already been assigned. Drawings can only exist on one Worksheet.');
}
}
@@ -235,6 +238,11 @@ class BaseDrawing implements IComparable
public function setCoordinates(string $coordinates): self
{
$this->coordinates = $coordinates;
+ if ($this->worksheet !== null) {
+ if (!($this instanceof Drawing && $this->getPath() === '')) {
+ $this->worksheet->getCell($this->coordinates);
+ }
+ }
return $this;
}
diff --git a/src/PhpSpreadsheet/Worksheet/Drawing.php b/src/PhpSpreadsheet/Worksheet/Drawing.php
index bee049100..35933af3f 100644
--- a/src/PhpSpreadsheet/Worksheet/Drawing.php
+++ b/src/PhpSpreadsheet/Worksheet/Drawing.php
@@ -148,6 +148,12 @@ class Drawing extends BaseDrawing
throw new PhpSpreadsheetException("File $path not found!");
}
+ if ($this->worksheet !== null) {
+ if ($this->path !== '') {
+ $this->worksheet->getCell($this->coordinates);
+ }
+ }
+
return $this;
}
diff --git a/src/PhpSpreadsheet/Writer/Html.php b/src/PhpSpreadsheet/Writer/Html.php
index 1b2d33abf..df1353ea0 100644
--- a/src/PhpSpreadsheet/Writer/Html.php
+++ b/src/PhpSpreadsheet/Writer/Html.php
@@ -5,6 +5,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Cell\Cell;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Chart\Chart;
use PhpOffice\PhpSpreadsheet\Comment;
use PhpOffice\PhpSpreadsheet\Document\Properties;
@@ -141,6 +142,12 @@ class Html extends BaseWriter
/** @var Chart[] */
private $sheetCharts;
+ private bool $betterBoolean = false;
+
+ private string $getTrue = 'TRUE';
+
+ private string $getFalse = 'FALSE';
+
/**
* Create a new HTML.
*/
@@ -148,6 +155,9 @@ class Html extends BaseWriter
{
$this->spreadsheet = $spreadsheet;
$this->defaultFont = $this->spreadsheet->getDefaultStyle()->getFont();
+ $calc = Calculation::getInstance($this->spreadsheet);
+ $this->getTrue = $calc->getTRUE();
+ $this->getFalse = $calc->getFALSE();
}
/**
@@ -1139,9 +1149,16 @@ class Html extends BaseWriter
// Create CSS
if ($fill->getFillType() !== Fill::FILL_NONE) {
- $value = $fill->getFillType() == Fill::FILL_NONE
- ? 'white' : '#' . $fill->getStartColor()->getRGB();
- $css['background-color'] = $value;
+ if (
+ (in_array($fill->getFillType(), ['', Fill::FILL_SOLID], true) || !$fill->getEndColor()->getRGB())
+ && $fill->getStartColor()->getRGB()
+ ) {
+ $value = '#' . $fill->getStartColor()->getRGB();
+ $css['background-color'] = $value;
+ } elseif ($fill->getEndColor()->getRGB()) {
+ $value = '#' . $fill->getEndColor()->getRGB();
+ $css['background-color'] = $value;
+ }
}
return $css;
@@ -1346,8 +1363,21 @@ class Html extends BaseWriter
if ($cell->getValue() instanceof RichText) {
$cellData .= $this->generateRowCellDataValueRich($cell->getValue());
} else {
- $origData = $this->preCalculateFormulas ? $cell->getCalculatedValue() : $cell->getValue();
- $origData2 = $this->preCalculateFormulas ? $cell->getCalculatedValueString() : $cell->getValueString();
+ if ($this->preCalculateFormulas) {
+ $origData = $cell->getCalculatedValue();
+ if ($this->betterBoolean && is_bool($origData)) {
+ $origData2 = $origData ? $this->getTrue : $this->getFalse;
+ } else {
+ $origData2 = $cell->getCalculatedValueString();
+ }
+ } else {
+ $origData = $cell->getValue();
+ if ($this->betterBoolean && is_bool($origData)) {
+ $origData2 = $origData ? $this->getTrue : $this->getFalse;
+ } else {
+ $origData2 = $cell->getValueString();
+ }
+ }
$formatCode = $worksheet->getParentOrThrow()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode();
$cellData = NumberFormat::toFormattedString(
@@ -1387,9 +1417,20 @@ class Html extends BaseWriter
$cellData = nl2br($cellData);
// Extend CSS class?
+ $dataType = $cell->getDataType();
+ if ($this->betterBoolean && $this->preCalculateFormulas && $dataType === DataType::TYPE_FORMULA) {
+ $calculatedValue = $cell->getCalculatedValue();
+ if (is_bool($calculatedValue)) {
+ $dataType = DataType::TYPE_BOOL;
+ } elseif (is_numeric($calculatedValue)) {
+ $dataType = DataType::TYPE_NUMERIC;
+ } elseif (is_string($calculatedValue)) {
+ $dataType = DataType::TYPE_STRING;
+ }
+ }
if (!$this->useInlineCss && is_string($cssClass)) {
$cssClass .= ' style' . $cell->getXfIndex();
- $cssClass .= ' ' . $cell->getDataType();
+ $cssClass .= ' ' . $dataType;
} elseif (is_array($cssClass)) {
$index = $cell->getXfIndex();
$styleIndex = 'td.style' . $index . ', th.style' . $index;
@@ -1403,7 +1444,7 @@ class Html extends BaseWriter
$sharedStyle->getAlignment()->getHorizontal() == Alignment::HORIZONTAL_GENERAL
&& isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])
) {
- $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
+ $cssClass['text-align'] = $this->cssStyles['.' . $dataType]['text-align'];
}
}
} else {
@@ -1448,6 +1489,16 @@ class Html extends BaseWriter
$htmlx .= $this->generateRowIncludeCharts($worksheet, $coordinate);
// Column start
$html .= ' <' . $cellType;
+ if ($this->betterBoolean) {
+ $dataType = $worksheet->getCell($coordinate)->getDataType();
+ if ($dataType === DataType::TYPE_BOOL) {
+ $html .= ' data-type="' . DataType::TYPE_BOOL . '"';
+ } elseif ($dataType === DataType::TYPE_FORMULA && is_bool($worksheet->getCell($coordinate)->getCalculatedValue())) {
+ $html .= ' data-type="' . DataType::TYPE_BOOL . '"';
+ } elseif (is_numeric($cellData) && $worksheet->getCell($coordinate)->getDataType() === DataType::TYPE_STRING) {
+ $html .= ' data-type="' . DataType::TYPE_STRING . '"';
+ }
+ }
if (!$this->useInlineCss && !$this->isPdf && is_string($cssClass)) {
$html .= ' class="' . $cssClass . '"';
if ($htmlx) {
@@ -1903,4 +1954,16 @@ class Html extends BaseWriter
return $sheet->getColumnDimension($colStr)->getVisible();
}
+
+ public function getBetterBoolean(): bool
+ {
+ return $this->betterBoolean;
+ }
+
+ public function setBetterBoolean(bool $betterBoolean): self
+ {
+ $this->betterBoolean = $betterBoolean;
+
+ return $this;
+ }
}
diff --git a/src/PhpSpreadsheet/Writer/Xls/Workbook.php b/src/PhpSpreadsheet/Writer/Xls/Workbook.php
index a1a5faf8f..c2b4496a5 100644
--- a/src/PhpSpreadsheet/Writer/Xls/Workbook.php
+++ b/src/PhpSpreadsheet/Writer/Xls/Workbook.php
@@ -210,8 +210,20 @@ class Workbook extends BIFFwriter
$xfWriter->setFontIndex($fontIndex);
// Background colors, best to treat these after the font so black will come after white in custom palette
- $xfWriter->setFgColor($this->addColor($style->getFill()->getStartColor()->getRGB()));
- $xfWriter->setBgColor($this->addColor($style->getFill()->getEndColor()->getRGB()));
+ if ($style->getFill()->getStartColor()->getRGB()) {
+ $xfWriter->setFgColor(
+ $this->addColor(
+ $style->getFill()->getStartColor()->getRGB()
+ )
+ );
+ }
+ if ($style->getFill()->getEndColor()->getRGB()) {
+ $xfWriter->setBgColor(
+ $this->addColor(
+ $style->getFill()->getEndColor()->getRGB()
+ )
+ );
+ }
$xfWriter->setBottomColor($this->addColor($style->getBorders()->getBottom()->getColor()->getRGB()));
$xfWriter->setTopColor($this->addColor($style->getBorders()->getTop()->getColor()->getRGB()));
$xfWriter->setRightColor($this->addColor($style->getBorders()->getRight()->getColor()->getRGB()));
diff --git a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
index 5258bbad3..5e3aa0b82 100644
--- a/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
+++ b/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
@@ -2875,9 +2875,9 @@ class Worksheet extends BIFFwriter
$bFormatBorder = 0;
}
// Pattern
- $bFillStyle = ($conditional->getStyle()->getFill()->getFillType() === null ? 0 : 1);
- $bFillColor = ($conditional->getStyle()->getFill()->getStartColor()->getARGB() === null ? 0 : 1);
- $bFillColorBg = ($conditional->getStyle()->getFill()->getEndColor()->getARGB() === null ? 0 : 1);
+ $bFillStyle = $conditional->getStyle()->getFill()->getFillType() ? 1 : 0;
+ $bFillColor = $conditional->getStyle()->getFill()->getStartColor()->getARGB() ? 1 : 0;
+ $bFillColorBg = $conditional->getStyle()->getFill()->getEndColor()->getARGB() ? 1 : 0;
if ($bFillStyle == 1 || $bFillColor == 1 || $bFillColorBg == 1) {
$bFormatFill = 1;
} else {
diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Style.php b/src/PhpSpreadsheet/Writer/Xlsx/Style.php
index a31b8e249..37c6c3127 100644
--- a/src/PhpSpreadsheet/Writer/Xlsx/Style.php
+++ b/src/PhpSpreadsheet/Writer/Xlsx/Style.php
@@ -199,7 +199,7 @@ class Style extends WriterPart
$objWriter->writeAttribute('position', '0');
// color
- if ($fill->getStartColor()->getARGB() !== null) {
+ if (!empty($fill->getStartColor()->getARGB())) {
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $fill->getStartColor()->getARGB());
$objWriter->endElement();
@@ -212,7 +212,7 @@ class Style extends WriterPart
$objWriter->writeAttribute('position', '1');
// color
- if ($fill->getEndColor()->getARGB() !== null) {
+ if (!empty($fill->getEndColor()->getARGB())) {
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $fill->getEndColor()->getARGB());
$objWriter->endElement();
@@ -244,7 +244,9 @@ class Style extends WriterPart
// patternFill
$objWriter->startElement('patternFill');
- $objWriter->writeAttribute('patternType', (string) $fill->getFillType());
+ if ($fill->getFillType()) {
+ $objWriter->writeAttribute('patternType', (string) $fill->getFillType());
+ }
if (self::writePatternColors($fill)) {
// fgColor
diff --git a/tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php b/tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php
index f1847fb64..976e8d54b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/ArrayFormulaTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class ArrayFormulaTest extends TestCase
{
- /**
- * @dataProvider providerArrayFormulae
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerArrayFormulae')]
public function testArrayFormula(string $formula, mixed $expectedResult): void
{
$result = Calculation::getInstance()->_calculateFormulaValue($formula);
diff --git a/tests/PhpSpreadsheetTests/Calculation/BinaryComparisonTest.php b/tests/PhpSpreadsheetTests/Calculation/BinaryComparisonTest.php
index 86b869756..5ceabe022 100644
--- a/tests/PhpSpreadsheetTests/Calculation/BinaryComparisonTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/BinaryComparisonTest.php
@@ -24,9 +24,7 @@ class BinaryComparisonTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerBinaryComparison
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinaryComparison')]
public function testBinaryComparisonOperation(
mixed $operand1,
mixed $operand2,
diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php
index 978162667..7a5e062ef 100644
--- a/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/CalculationFunctionListTest.php
@@ -24,9 +24,7 @@ class CalculationFunctionListTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerGetFunctions
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetFunctions')]
public function testGetFunctions(array|string $functionCall): void
{
self::assertIsCallable($functionCall);
diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationSettingsTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationSettingsTest.php
index afaf58d0e..d57161fd5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/CalculationSettingsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/CalculationSettingsTest.php
@@ -29,9 +29,7 @@ class CalculationSettingsTest extends TestCase
$calculation->setLocale($this->locale);
}
- /**
- * @dataProvider providerCanLoadAllSupportedLocales
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCanLoadAllSupportedLocales')]
public function testCanLoadAllSupportedLocales(string $locale): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php
index 4910eb0ba..3a4e67aef 100644
--- a/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/CalculationTest.php
@@ -27,9 +27,7 @@ class CalculationTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerBinaryComparisonOperation
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinaryComparisonOperation')]
public function testBinaryComparisonOperation(string $formula, mixed $expectedResultExcel, mixed $expectedResultOpenOffice): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
@@ -374,9 +372,8 @@ class CalculationTest extends TestCase
* be set in cache
* @param string[] $shouldNotBeSetInCacheCells coordinates of cells that must
* not be set in cache because of pruning
- *
- * @dataProvider dataProviderBranchPruningFullExecution
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderBranchPruningFullExecution')]
public function testFullExecutionDataPruning(
mixed $expectedResult,
array $dataArray,
diff --git a/tests/PhpSpreadsheetTests/Calculation/DefinedNamesCalculationTest.php b/tests/PhpSpreadsheetTests/Calculation/DefinedNamesCalculationTest.php
index d011f3c7f..4485a591e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/DefinedNamesCalculationTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/DefinedNamesCalculationTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class DefinedNamesCalculationTest extends TestCase
{
- /**
- * @dataProvider namedRangeCalculationTest1
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('namedRangeCalculationTest1')]
public function testNamedRangeCalculations1(string $cellAddress, float $expectedValue): void
{
$inputFileType = 'Xlsx';
@@ -24,9 +22,7 @@ class DefinedNamesCalculationTest extends TestCase
self::assertSame($expectedValue, $calculatedCellValue, "Failed calculation for cell {$cellAddress}");
}
- /**
- * @dataProvider namedRangeCalculationTest2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('namedRangeCalculationTest2')]
public function testNamedRangeCalculationsWithAdjustedRateValue(string $cellAddress, float $expectedValue): void
{
$inputFileType = 'Xlsx';
@@ -41,9 +37,7 @@ class DefinedNamesCalculationTest extends TestCase
self::assertSame($expectedValue, $calculatedCellValue, "Failed calculation for cell {$cellAddress}");
}
- /**
- * @dataProvider namedRangeCalculationTest1
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('namedRangeCalculationTest1')]
public function testNamedFormulaCalculations1(string $cellAddress, float $expectedValue): void
{
$inputFileType = 'Xlsx';
@@ -56,9 +50,7 @@ class DefinedNamesCalculationTest extends TestCase
self::assertSame($expectedValue, $calculatedCellValue, "Failed calculation for cell {$cellAddress}");
}
- /**
- * @dataProvider namedRangeCalculationTest2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('namedRangeCalculationTest2')]
public function testNamedFormulaeCalculationsWithAdjustedRateValue(string $cellAddress, float $expectedValue): void
{
$inputFileType = 'Xlsx';
diff --git a/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberSlashTest.php b/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberSlashTest.php
index c23f73870..d9dd25142 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberSlashTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberSlashTest.php
@@ -17,9 +17,7 @@ class FormattedNumberSlashTest extends TestCase
StringHelper::setThousandsSeparator(null);
}
- /**
- * @dataProvider providerNumbers
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumbers')]
public function testNumber(float $expected, string $value, string $thousandsSeparator = ',', string $decimalSeparator = '.'): void
{
StringHelper::setThousandsSeparator($thousandsSeparator);
@@ -38,9 +36,7 @@ class FormattedNumberSlashTest extends TestCase
];
}
- /**
- * @dataProvider providerPercentages
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPercentages')]
public function testPercentage(string $expected, string $value, string $thousandsSeparator = ',', string $decimalSeparator = '.'): void
{
$originalValue = $value;
@@ -61,9 +57,7 @@ class FormattedNumberSlashTest extends TestCase
];
}
- /**
- * @dataProvider providerCurrencies
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCurrencies')]
public function testCurrencies(string $expected, string $value, string $thousandsSeparator = ',', string $decimalSeparator = '.', ?string $currencyCode = null): void
{
$originalValue = $value;
diff --git a/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberTest.php b/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberTest.php
index fef4d66b5..3410a04c6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Engine/FormattedNumberTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class FormattedNumberTest extends TestCase
{
- /**
- * @dataProvider providerNumbers
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumbers')]
public function testNumber(float $expected, string $value): void
{
FormattedNumber::convertToNumberIfFormatted($value);
@@ -31,9 +29,7 @@ class FormattedNumberTest extends TestCase
];
}
- /**
- * @dataProvider providerFractions
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFractions')]
public function testFraction(string $expected, string $value): void
{
$originalValue = $value;
@@ -60,9 +56,7 @@ class FormattedNumberTest extends TestCase
];
}
- /**
- * @dataProvider providerPercentages
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPercentages')]
public function testPercentage(string $expected, string $value): void
{
$originalValue = $value;
@@ -189,9 +183,7 @@ class FormattedNumberTest extends TestCase
];
}
- /**
- * @dataProvider providerCurrencies
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCurrencies')]
public function testCurrencies(string $expected, string $value): void
{
$originalValue = $value;
diff --git a/tests/PhpSpreadsheetTests/Calculation/Engine/RangeTest.php b/tests/PhpSpreadsheetTests/Calculation/Engine/RangeTest.php
index aa7bc529d..85ed7fdc4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Engine/RangeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Engine/RangeTest.php
@@ -33,9 +33,7 @@ class RangeTest extends TestCase
}
}
- /**
- * @dataProvider providerRangeEvaluation
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRangeEvaluation')]
public function testRangeEvaluation(string $formula, int|string $expectedResult): void
{
$this->spreadSheet = $this->getSpreadsheet();
@@ -97,9 +95,7 @@ class RangeTest extends TestCase
$workSheet->getCell('E1')->getCalculatedValue();
}
- /**
- * @dataProvider providerNamedRangeEvaluation
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNamedRangeEvaluation')]
public function testNamedRangeEvaluation(array $ranges, string $formula, int $expectedResult): void
{
$this->spreadSheet = $this->getSpreadsheet();
@@ -134,11 +130,10 @@ class RangeTest extends TestCase
}
/**
- * @dataProvider providerUTF8NamedRangeEvaluation
- *
* @param string[] $names
* @param string[] $ranges
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUTF8NamedRangeEvaluation')]
public function testUTF8NamedRangeEvaluation(array $names, array $ranges, string $formula, int $expectedResult): void
{
$this->spreadSheet = $this->getSpreadsheet();
@@ -162,9 +157,7 @@ class RangeTest extends TestCase
];
}
- /**
- * @dataProvider providerCompositeNamedRangeEvaluation
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCompositeNamedRangeEvaluation')]
public function testCompositeNamedRangeEvaluation(string $composite, int $expectedSum, int $expectedCount): void
{
if ($this->incompleteMessage !== '') {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceSlashTest.php b/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceSlashTest.php
index bd94002f9..68e5f3ade 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceSlashTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceSlashTest.php
@@ -54,9 +54,7 @@ class StructuredReferenceSlashTest extends TestCase
parent::tearDown();
}
- /**
- * @dataProvider structuredReferenceProviderColumnData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('structuredReferenceProviderColumnData')]
public function testStructuredReferenceColumns(string $expectedCellRange, string $structuredReference): void
{
$spreadsheet = $this->getSpreadsheet();
@@ -65,9 +63,7 @@ class StructuredReferenceSlashTest extends TestCase
self::assertSame($expectedCellRange, $cellRange);
}
- /**
- * @dataProvider structuredReferenceProviderRowData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('structuredReferenceProviderRowData')]
public function testStructuredReferenceRows(string $expectedCellRange, string $structuredReference): void
{
$spreadsheet = $this->getSpreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceTest.php b/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceTest.php
index 459795701..40223813d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Engine/StructuredReferenceTest.php
@@ -70,9 +70,7 @@ class StructuredReferenceTest extends TestCase
$structuredReferenceObject->parse($cell);
}
- /**
- * @dataProvider structuredReferenceProviderColumnData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('structuredReferenceProviderColumnData')]
public function testStructuredReferenceColumns(string $expectedCellRange, string $structuredReference): void
{
$cell = $this->spreadSheet->getActiveSheet()->getCell('E5');
@@ -82,9 +80,7 @@ class StructuredReferenceTest extends TestCase
self::assertSame($expectedCellRange, $cellRange);
}
- /**
- * @dataProvider structuredReferenceProviderRowData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('structuredReferenceProviderRowData')]
public function testStructuredReferenceRows(string $expectedCellRange, string $structuredReference): void
{
$cell = $this->spreadSheet->getActiveSheet()->getCell('E5');
diff --git a/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php b/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php
index aeb13e0b5..ab6c40e67 100644
--- a/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/FormulaAsStringTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class FormulaAsStringTest extends TestCase
{
- /**
- * @dataProvider providerFunctionsAsString
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFunctionsAsString')]
public function testFunctionsAsString(mixed $expectedResult, string $formula): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/FormulaParserTest.php b/tests/PhpSpreadsheetTests/Calculation/FormulaParserTest.php
index 10ce2cd48..a747710de 100644
--- a/tests/PhpSpreadsheetTests/Calculation/FormulaParserTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/FormulaParserTest.php
@@ -31,9 +31,7 @@ class FormulaParserTest extends TestCase
self::assertSame(0, $result->getTokenCount());
}
- /**
- * @dataProvider providerFormulaParser
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormulaParser')]
public function testFormulaParser(string $formula, array $expectedResult): void
{
$formula = "=$formula";
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php
index 18978afa0..75d381ea7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DAverageTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DAverageTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDAverage
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAverage')]
public function testDirectCallToDAverage(int|float|string $expectedResult, array $database, string|int|null $field, array $criteria): void
{
$result = DAverage::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDAverage
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAverage')]
public function testDAverageAsWorksheetFormula(int|float|string $expectedResult, array $database, string|int|null $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DAVERAGE', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php
index 6ddcfd6cb..2a9fd2f40 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountATest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DCountATest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDCountA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDCountA')]
public function testDirectCallToDCountA(int|string $expectedResult, array $database, string $field, array $criteria): void
{
$result = DCountA::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDCountA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDCountA')]
public function testDCountAAsWorksheetFormula(int|string $expectedResult, array $database, string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DCOUNTA', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php
index ded350b93..4a3e18cef 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DCountTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DCountTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDCount
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDCount')]
public function testDirectCallToDCount(int|string $expectedResult, array $database, string|int|null $field, array $criteria): void
{
$result = DCount::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDCount
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDCount')]
public function testDCountAsWorksheetFormula(int|string $expectedResult, array $database, string|int|null $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DCOUNT', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php
index 052261604..57b9e9bdb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DGetTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DGetTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDGet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDGet')]
public function testDirectCallToDGet(string|int $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DGet::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDGet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDGet')]
public function testDGetAsWorksheetFormula(string|int $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DGET', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php
index 2689fa3cf..ec8fa3ff8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMaxTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DMaxTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDMax
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDMax')]
public function testDirectCallToDMax(int|string $expectedResult, array $database, string|null|int $field, array $criteria): void
{
$result = DMax::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDMax
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDMax')]
public function testDMaxAsWorksheetFormula(int|string $expectedResult, array $database, string|null|int $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DMAX', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php
index c1e553dc1..5fb3d121f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DMinTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DMinTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDMin
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDMin')]
public function testDirectCallToDMin(int|float|string $expectedResult, array $database, string|null|int $field, array $criteria): void
{
$result = DMin::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDMin
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDMin')]
public function testDMinAsWorksheetFormula(int|float|string $expectedResult, array $database, string|null|int $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DMIN', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php
index 57590ee25..dd86903b5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DProductTest.php
@@ -10,18 +10,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DProductTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDProduct
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDProduct')]
public function testDirectCallToDProduct(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DProduct::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDProduct
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDProduct')]
public function testDProductAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DPRODUCT', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php
index bb80b211b..349abcae5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevPTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DStDevPTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDStDevP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDStDevP')]
public function testDirectCallToDStDevP(float|int|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DStDevP::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDStDevP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDStDevP')]
public function testDStDevPAsWorksheetFormula(float|int|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DSTDEVP', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php
index 73eb7a410..2edd578c4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DStDevTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DStDevTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDStDev
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDStDev')]
public function testDirectCallToDStDev(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DStDev::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDStDev
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDStDev')]
public function testDStDevAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DSTDEV', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php
index 3589e8959..6f97f49f9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DSumTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DSumTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDSum
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDSum')]
public function testDirectCallToDSum(int|float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DSum::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDSum
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDSum')]
public function testDSumAsWorksheetFormula(int|float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DSUM', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php
index c880bb62e..a3bbbf32a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarPTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DVarPTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDVarP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDVarP')]
public function testDirectCallToDVarP(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DVarP::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDVarP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDVarP')]
public function testDVarPAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DVARP', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php
index 7a0e923f9..0a77db76e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Database/DVarTest.php
@@ -9,18 +9,14 @@ use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;
class DVarTest extends SetupTeardownDatabases
{
- /**
- * @dataProvider providerDVar
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDVar')]
public function testDirectCallToDVar(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$result = DVar::evaluate($database, $field, $criteria);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerDVar
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDVar')]
public function testDVarAsWorksheetFormula(float|string $expectedResult, array $database, ?string $field, array $criteria): void
{
$this->prepareWorksheetWithFormula('DVAR', $database, $field, $criteria);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php
index 79cc6f0a7..e6d81c882 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateDifTest.php
@@ -16,18 +16,14 @@ use PHPUnit\Framework\TestCase;
class DateDifTest extends TestCase
{
- /**
- * @dataProvider providerDATEDIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEDIF')]
public function testDirectCallToDATEDIF(array|int|string $expectedResult, string ...$args): void
{
$result = Difference::interval(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDATEDIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEDIF')]
public function testDATEDIFAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -39,9 +35,7 @@ class DateDifTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDATEDIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEDIF')]
public function testDATEDIFInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -64,9 +58,7 @@ class DateDifTest extends TestCase
return require 'tests/data/Calculation/DateTime/DATEDIF.php';
}
- /**
- * @dataProvider providerUnhappyDATEDIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDATEDIF')]
public function testDATEDIFUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -99,9 +91,7 @@ class DateDifTest extends TestCase
self::assertSame(31, Days::between($obj1, $obj2));
}
- /**
- * @dataProvider providerDateDifArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateDifArray')]
public function testDateDifArray(array $expectedResult, string $startDate, string $endDate, ?string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php
index 57d535a03..043c35b7b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateTest.php
@@ -36,18 +36,14 @@ class DateTest extends TestCase
Functions::setReturnDateType($this->returnDateType);
}
- /**
- * @dataProvider providerDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATE')]
public function testDirectCallToDATE(float|string $expectedResult, int|string $year, float|int|string $month, float|int|string $day): void
{
$result = Date::fromYMD($year, $month, $day);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATE')]
public function testDATEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -59,9 +55,7 @@ class DateTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATE')]
public function testDATEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -84,9 +78,7 @@ class DateTest extends TestCase
return require 'tests/data/Calculation/DateTime/DATE.php';
}
- /**
- * @dataProvider providerUnhappyDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDATE')]
public function testDATEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -144,9 +136,7 @@ class DateTest extends TestCase
self::assertEquals($result, ExcelError::NAN());
}
- /**
- * @dataProvider providerDateArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateArray')]
public function testDateArray(array $expectedResult, string $year, string $month, string $day): void
{
$calculation = Calculation::getInstance();
@@ -210,9 +200,7 @@ class DateTest extends TestCase
];
}
- /**
- * @dataProvider providerDateArrayException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateArrayException')]
public function testDateArrayException(string $year, string $month, string $day): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php
index 27b652e42..4c2d0d4bc 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DateValueTest.php
@@ -54,9 +54,7 @@ class DateValueTest extends TestCase
return (string) $x;
}
- /**
- * @dataProvider providerDATEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEVALUE')]
public function testDirectCallToDATEVALUE(int|string $expectedResult, bool|int|string $value): void
{
if ($this->expectationIsTemplate($expectedResult)) {
@@ -67,9 +65,7 @@ class DateValueTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8);
}
- /**
- * @dataProvider providerDATEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEVALUE')]
public function testDATEVALUEAsFormula(float|int|string $expectedResult, mixed ...$args): void
{
if ($this->expectationIsTemplate($expectedResult)) {
@@ -85,9 +81,7 @@ class DateValueTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8);
}
- /**
- * @dataProvider providerDATEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDATEVALUE')]
public function testDATEVALUEInWorksheet(float|int|string $expectedResult, mixed ...$args): void
{
if ($this->expectationIsTemplate($expectedResult)) {
@@ -123,9 +117,7 @@ class DateValueTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerUnhappyDATEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDATEVALUE')]
public function testDATEVALUEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -183,9 +175,7 @@ class DateValueTest extends TestCase
self::assertEquals('#VALUE!', DateValue::fromString('1900-02-29'));
}
- /**
- * @dataProvider providerDateValueArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateValueArray')]
public function testDateValueArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php
index c439d0375..e507deef6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DayTest.php
@@ -30,18 +30,14 @@ class DayTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAY')]
public function testDirectCallToDAY(mixed $expectedResultExcel, mixed ...$args): void
{
$result = DateParts::day(...$args);
self::assertSame($expectedResultExcel, $result);
}
- /**
- * @dataProvider providerDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAY')]
public function testDAYAsFormula(mixed $expectedResultExcel, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class DayTest extends TestCase
self::assertSame($expectedResultExcel, $result);
}
- /**
- * @dataProvider providerDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAY')]
public function testDAYInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -78,9 +72,7 @@ class DayTest extends TestCase
return require 'tests/data/Calculation/DateTime/DAY.php';
}
- /**
- * @dataProvider providerDAYOpenOffice
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYOpenOffice')]
public function testDirectCallToDAYOpenOffice(mixed $expectedResultOpenOffice, mixed ...$args): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -89,9 +81,7 @@ class DayTest extends TestCase
self::assertSame($expectedResultOpenOffice, $result);
}
- /**
- * @dataProvider providerDAYOpenOffice
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYOpenOffice')]
public function testDAYAsFormulaOpenOffice(mixed $expectedResultOpenOffice, mixed ...$args): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -110,9 +100,7 @@ class DayTest extends TestCase
return require 'tests/data/Calculation/DateTime/DAYOpenOffice.php';
}
- /**
- * @dataProvider providerUnhappyDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDAY')]
public function testDAYUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -144,9 +132,7 @@ class DayTest extends TestCase
self::assertSame(0, $result);
}
- /**
- * @dataProvider providerDayArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDayArray')]
public function testDayArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php
index 9f8c9a608..1967b0965 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/Days360Test.php
@@ -16,18 +16,14 @@ use PHPUnit\Framework\TestCase;
class Days360Test extends TestCase
{
- /**
- * @dataProvider providerDAYS360
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS360')]
public function testDirectCallToDAYS360(mixed $expectedResult, mixed ...$args): void
{
$result = Days360::between(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDAYS360
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS360')]
public function testDAYS360AsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -39,9 +35,7 @@ class Days360Test extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDAYS360
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS360')]
public function testDAYS360InWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -64,9 +58,7 @@ class Days360Test extends TestCase
return require 'tests/data/Calculation/DateTime/DAYS360.php';
}
- /**
- * @dataProvider providerUnhappyDAYS360
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDAYS360')]
public function testDAYS360UnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -99,9 +91,7 @@ class Days360Test extends TestCase
self::assertSame(31, Days::between($obj1, $obj2));
}
- /**
- * @dataProvider providerDays360Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDays360Array')]
public function testDays360Array(array $expectedResult, string $startDate, string $endDate, ?string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php
index 8a783a3ec..7ba4f5ecf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/DaysTest.php
@@ -15,18 +15,14 @@ use PHPUnit\Framework\TestCase;
class DaysTest extends TestCase
{
- /**
- * @dataProvider providerDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS')]
public function testDirectCallToDAYS(int|string $expectedResult, int|string $date1, int|string $date2): void
{
$result = Days::between($date1, $date2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS')]
public function testDAYSAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class DaysTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDAYS')]
public function testDAYSInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class DaysTest extends TestCase
return require 'tests/data/Calculation/DateTime/DAYS.php';
}
- /**
- * @dataProvider providerUnhappyDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDAYS')]
public function testDAYSUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -98,9 +90,7 @@ class DaysTest extends TestCase
self::assertSame(31, Days::between($obj1, $obj2));
}
- /**
- * @dataProvider providerDaysArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDaysArray')]
public function testDaysArray(array $expectedResult, string $startDate, string $endDate): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php
index a1618cf0d..3b5b05434 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EDateTest.php
@@ -30,18 +30,14 @@ class EDateTest extends TestCase
Functions::setReturnDateType($this->returnDateType);
}
- /**
- * @dataProvider providerEDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEDATE')]
public function testDirectCallToEDATE(mixed $expectedResult, mixed ...$args): void
{
$result = Month::adjust(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerEDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEDATE')]
public function testEDATEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class EDateTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerEDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEDATE')]
public function testEDATEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -78,9 +72,7 @@ class EDateTest extends TestCase
return require 'tests/data/Calculation/DateTime/EDATE.php';
}
- /**
- * @dataProvider providerUnhappyEDATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyEDATE')]
public function testEDATEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -129,9 +121,7 @@ class EDateTest extends TestCase
self::assertEquals($result->format('d-M-Y'), '26-Dec-2011');
}
- /**
- * @dataProvider providerEDateArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEDateArray')]
public function testEDateArray(array $expectedResult, string $dateValues, string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php
index a6d573896..1b5a74795 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/EoMonthTest.php
@@ -30,18 +30,14 @@ class EoMonthTest extends TestCase
Functions::setReturnDateType($this->returnDateType);
}
- /**
- * @dataProvider providerEOMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEOMONTH')]
public function testDirectCallToEOMONTH(mixed $expectedResult, mixed ...$args): void
{
$result = Month::lastDay(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerEOMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEOMONTH')]
public function testEOMONTHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class EoMonthTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerEOMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEOMONTH')]
public function testEOMONTHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -78,9 +72,7 @@ class EoMonthTest extends TestCase
return require 'tests/data/Calculation/DateTime/EOMONTH.php';
}
- /**
- * @dataProvider providerUnhappyEOMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyEOMONTH')]
public function testEOMONTHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -128,9 +120,7 @@ class EoMonthTest extends TestCase
self::assertSame($result->format('d-M-Y'), '31-Dec-2011');
}
- /**
- * @dataProvider providerEoMonthArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEoMonthArray')]
public function testEoMonthArray(array $expectedResult, string $dateValues, string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php
index c787aed98..0b4c27a0e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/HourTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class HourTest extends TestCase
{
- /**
- * @dataProvider providerHOUR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHOUR')]
public function testDirectCallToHOUR(mixed $expectedResult, mixed ...$args): void
{
$result = TimeParts::hour(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerHOUR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHOUR')]
public function testHOURAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class HourTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerHOUR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHOUR')]
public function testHOURInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class HourTest extends TestCase
return require 'tests/data/Calculation/DateTime/HOUR.php';
}
- /**
- * @dataProvider providerUnhappyHOUR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyHOUR')]
public function testHOURUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class HourTest extends TestCase
];
}
- /**
- * @dataProvider providerHourArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHourArray')]
public function testHourArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php
index b66fab6ab..863d9f35d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/IsoWeekNumTest.php
@@ -30,18 +30,14 @@ class IsoWeekNumTest extends TestCase
SharedDate::setExcelCalendar($this->excelCalendar);
}
- /**
- * @dataProvider providerISOWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerISOWEEKNUM')]
public function testDirectCallToISOWEEKNUM(mixed $expectedResult, mixed ...$args): void
{
$result = Week::isoWeekNumber(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerISOWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerISOWEEKNUM')]
public function testISOWEEKNUMAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class IsoWeekNumTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerISOWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerISOWEEKNUM')]
public function testISOWEEKNUMInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -78,9 +72,7 @@ class IsoWeekNumTest extends TestCase
return require 'tests/data/Calculation/DateTime/ISOWEEKNUM.php';
}
- /**
- * @dataProvider providerUnhappyISOWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyISOWEEKNUM')]
public function testISOWEEKNUMUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -106,9 +98,7 @@ class IsoWeekNumTest extends TestCase
];
}
- /**
- * @dataProvider providerISOWEEKNUM1904
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerISOWEEKNUM1904')]
public function testISOWEEKNUMWith1904Calendar(mixed $expectedResult, mixed ...$args): void
{
SharedDate::setExcelCalendar(SharedDate::CALENDAR_MAC_1904);
@@ -122,9 +112,7 @@ class IsoWeekNumTest extends TestCase
return require 'tests/data/Calculation/DateTime/ISOWEEKNUM1904.php';
}
- /**
- * @dataProvider providerIsoWeekNumArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsoWeekNumArray')]
public function testIsoWeekNumArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php
index 4e354faa2..177a684c6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MinuteTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class MinuteTest extends TestCase
{
- /**
- * @dataProvider providerMINUTE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINUTE')]
public function testDirectCallToMINUTE(mixed $expectedResult, mixed ...$args): void
{
$result = TimeParts::MINUTE(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerMINUTE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINUTE')]
public function testMINUTEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class MinuteTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerMINUTE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINUTE')]
public function testMINUTEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class MinuteTest extends TestCase
return require 'tests/data/Calculation/DateTime/MINUTE.php';
}
- /**
- * @dataProvider providerUnhappyMINUTE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyMINUTE')]
public function testMINUTEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class MinuteTest extends TestCase
];
}
- /**
- * @dataProvider providerMinuteArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMinuteArray')]
public function testMinuteArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php
index d3434d1d9..969d07fc0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/MonthTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class MonthTest extends TestCase
{
- /**
- * @dataProvider providerMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMONTH')]
public function testDirectCallToMONTH(mixed $expectedResultExcel, mixed ...$args): void
{
$result = DateParts::month(...$args);
self::assertSame($expectedResultExcel, $result);
}
- /**
- * @dataProvider providerMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMONTH')]
public function testMONTHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class MonthTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMONTH')]
public function testMONTHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class MonthTest extends TestCase
return require 'tests/data/Calculation/DateTime/MONTH.php';
}
- /**
- * @dataProvider providerUnhappyMONTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyMONTH')]
public function testMONTHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class MonthTest extends TestCase
];
}
- /**
- * @dataProvider providerMonthArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMonthArray')]
public function testMonthArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php
index 0e853040a..a2640f38a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/NetworkDaysTest.php
@@ -12,18 +12,14 @@ use PHPUnit\Framework\TestCase;
class NetworkDaysTest extends TestCase
{
- /**
- * @dataProvider providerNETWORKDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNETWORKDAYS')]
public function testDirectCallToNETWORKDAYS(mixed $expectedResult, mixed ...$args): void
{
$result = NetworkDays::count(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerNETWORKDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNETWORKDAYS')]
public function testNETWORKDAYSAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -35,9 +31,7 @@ class NetworkDaysTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerNETWORKDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNETWORKDAYS')]
public function testNETWORKDAYSInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +54,7 @@ class NetworkDaysTest extends TestCase
return require 'tests/data/Calculation/DateTime/NETWORKDAYS.php';
}
- /**
- * @dataProvider providerUnhappyNETWORKDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyNETWORKDAYS')]
public function testNETWORKDAYSUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class NetworkDaysTest extends TestCase
];
}
- /**
- * @dataProvider providerNetWorkDaysArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNetWorkDaysArray')]
public function testNetWorkDaysArray(array $expectedResult, string $startDate, string $endDays, ?string $holidays): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php
index 72f9ccb60..151044960 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/SecondTest.php
@@ -12,18 +12,14 @@ use PHPUnit\Framework\TestCase;
class SecondTest extends TestCase
{
- /**
- * @dataProvider providerSECOND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSECOND')]
public function testDirectCallToSECOND(mixed $expectedResult, mixed ...$args): void
{
$result = TimeParts::second(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerSECOND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSECOND')]
public function testSECONDAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -35,9 +31,7 @@ class SecondTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerSECOND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSECOND')]
public function testSECONDInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +54,7 @@ class SecondTest extends TestCase
return require 'tests/data/Calculation/DateTime/SECOND.php';
}
- /**
- * @dataProvider providerUnhappySECOND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappySECOND')]
public function testSECONDUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +80,7 @@ class SecondTest extends TestCase
];
}
- /**
- * @dataProvider providerSecondArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSecondArray')]
public function testSecondArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php
index 3f757315b..71e5e02f7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeTest.php
@@ -36,18 +36,14 @@ class TimeTest extends TestCase
Functions::setReturnDateType($this->returnDateType);
}
- /**
- * @dataProvider providerTIME
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTIME')]
public function testDirectCallToTIME(float|string $expectedResult, int|string $hour, bool|int $minute, int $second): void
{
$result = Time::fromHMS($hour, $minute, $second);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-12);
}
- /**
- * @dataProvider providerTIME
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTIME')]
public function testTIMEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -64,9 +60,7 @@ class TimeTest extends TestCase
return require 'tests/data/Calculation/DateTime/TIME.php';
}
- /**
- * @dataProvider providerUnhappyTIME
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyTIME')]
public function testTIMEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -127,9 +121,7 @@ class TimeTest extends TestCase
self::assertEquals(0, $result);
}
- /**
- * @dataProvider providerTimeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTimeArray')]
public function testTimeArray(array $expectedResult, string $hour, string $minute, string $second): void
{
$calculation = Calculation::getInstance();
@@ -193,9 +185,7 @@ class TimeTest extends TestCase
];
}
- /**
- * @dataProvider providerTimeArrayException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTimeArrayException')]
public function testTimeArrayException(string $hour, string $minute, string $second): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php
index f512d4c45..769254e59 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/TimeValueTest.php
@@ -30,18 +30,14 @@ class TimeValueTest extends TestCase
Functions::setReturnDateType($this->returnDateType);
}
- /**
- * @dataProvider providerTIMEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTIMEVALUE')]
public function testDirectCallToTIMEVALUE(int|float|string $expectedResult, bool|int|string $value): void
{
$result = TimeValue::fromString($value);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8);
}
- /**
- * @dataProvider providerTIMEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTIMEVALUE')]
public function testTIMEVALUEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class TimeValueTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-8);
}
- /**
- * @dataProvider providerTIMEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTIMEVALUE')]
public function testTIMEVALUEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +103,7 @@ class TimeValueTest extends TestCase
self::assertEquals($result->format('H:i:s'), '07:30:20');
}
- /**
- * @dataProvider providerUnhappyTIMEVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyTIMEVALUE')]
public function testTIMEVALUEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -137,9 +129,7 @@ class TimeValueTest extends TestCase
];
}
- /**
- * @dataProvider providerTimeValueArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTimeValueArray')]
public function testTimeValueArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php
index c147b8446..f97be1ec5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekDayTest.php
@@ -29,18 +29,14 @@ class WeekDayTest extends TestCase
SharedDate::setExcelCalendar($this->excelCalendar);
}
- /**
- * @dataProvider providerWEEKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKDAY')]
public function testDirectCallToWEEKDAY(int|string $expectedResult, bool|int|string $dateValue, null|int|string $style = null): void
{
$result = ($style === null) ? Week::day($dateValue) : Week::day($dateValue, $style);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWEEKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKDAY')]
public function testWEEKDAYAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -52,9 +48,7 @@ class WeekDayTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWEEKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKDAY')]
public function testWEEKDAYInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -77,9 +71,7 @@ class WeekDayTest extends TestCase
return require 'tests/data/Calculation/DateTime/WEEKDAY.php';
}
- /**
- * @dataProvider providerUnhappyWEEKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyWEEKDAY')]
public function testWEEKDAYUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -114,9 +106,7 @@ class WeekDayTest extends TestCase
self::assertEquals(6, Week::day(null));
}
- /**
- * @dataProvider providerWeekDayArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWeekDayArray')]
public function testWeekDayArray(array $expectedResult, string $dateValues, string $styles): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php
index bff6ec619..a08c13a06 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WeekNumTest.php
@@ -30,18 +30,14 @@ class WeekNumTest extends TestCase
SharedDate::setExcelCalendar($this->excelCalendar);
}
- /**
- * @dataProvider providerWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKNUM')]
public function testDirectCallToWEEKNUM(mixed $expectedResult, mixed ...$args): void
{
$result = Week::number(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKNUM')]
public function testWEEKNUMAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -53,9 +49,7 @@ class WeekNumTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKNUM')]
public function testWEEKNUMInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -78,9 +72,7 @@ class WeekNumTest extends TestCase
return require 'tests/data/Calculation/DateTime/WEEKNUM.php';
}
- /**
- * @dataProvider providerUnhappyWEEKNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyWEEKNUM')]
public function testWEEKNUMUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -106,9 +98,7 @@ class WeekNumTest extends TestCase
];
}
- /**
- * @dataProvider providerWEEKNUM1904
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEEKNUM1904')]
public function testWEEKNUMWith1904Calendar(mixed $expectedResult, mixed ...$args): void
{
SharedDate::setExcelCalendar(SharedDate::CALENDAR_MAC_1904);
@@ -122,9 +112,7 @@ class WeekNumTest extends TestCase
return require 'tests/data/Calculation/DateTime/WEEKNUM1904.php';
}
- /**
- * @dataProvider providerWeekNumArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWeekNumArray')]
public function testWeekNumArray(array $expectedResult, string $dateValues, string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php
index db9d95d17..06c65ff6d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/WorkDayTest.php
@@ -12,18 +12,14 @@ use PHPUnit\Framework\TestCase;
class WorkDayTest extends TestCase
{
- /**
- * @dataProvider providerWORKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWORKDAY')]
public function testDirectCallToWORKDAY(mixed $expectedResult, mixed ...$args): void
{
$result = WorkDay::date(...$args);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWORKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWORKDAY')]
public function testWORKDAYAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -35,9 +31,7 @@ class WorkDayTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerWORKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWORKDAY')]
public function testWORKDAYInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +54,7 @@ class WorkDayTest extends TestCase
return require 'tests/data/Calculation/DateTime/WORKDAY.php';
}
- /**
- * @dataProvider providerUnhappyWORKDAY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyWORKDAY')]
public function testWORKDAYUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +80,7 @@ class WorkDayTest extends TestCase
];
}
- /**
- * @dataProvider providerWorkDayArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWorkDayArray')]
public function testWorkDayArray(array $expectedResult, string $startDate, string $endDays, ?string $holidays): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php
index 74157492a..0ad70f954 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearFracTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class YearFracTest extends TestCase
{
- /**
- * @dataProvider providerYEARFRAC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEARFRAC')]
public function testDirectCallToYEARFRAC(mixed $expectedResult, mixed ...$args): void
{
$result = YearFrac::fraction(...$args);
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-6);
}
- /**
- * @dataProvider providerYEARFRAC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEARFRAC')]
public function testYEARFRACAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class YearFracTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, 1.0e-6);
}
- /**
- * @dataProvider providerYEARFRAC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEARFRAC')]
public function testYEARFRACInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class YearFracTest extends TestCase
return require 'tests/data/Calculation/DateTime/YEARFRAC.php';
}
- /**
- * @dataProvider providerUnhappyYEARFRAC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyYEARFRAC')]
public function testYEARFRACUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class YearFracTest extends TestCase
];
}
- /**
- * @dataProvider providerYearFracArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYearFracArray')]
public function testYearFracArray(array $expectedResult, string $startDate, string $endDate, ?string $methods): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php
index 6234900e5..6a7f5a095 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/DateTime/YearTest.php
@@ -12,18 +12,14 @@ use PHPUnit\Framework\TestCase;
class YearTest extends TestCase
{
- /**
- * @dataProvider providerYEAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEAR')]
public function testDirectCallToYEAR(mixed $expectedResultExcel, mixed ...$args): void
{
$result = DateParts::year(...$args);
self::assertSame($expectedResultExcel, $result);
}
- /**
- * @dataProvider providerYEAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEAR')]
public function testYEARAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -35,9 +31,7 @@ class YearTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerYEAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYEAR')]
public function testYEARInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +54,7 @@ class YearTest extends TestCase
return require 'tests/data/Calculation/DateTime/YEAR.php';
}
- /**
- * @dataProvider providerUnhappyYEAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyYEAR')]
public function testYEARUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +80,7 @@ class YearTest extends TestCase
];
}
- /**
- * @dataProvider providerYearArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYearArray')]
public function testYearArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php
index 8a659358c..603f23533 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselITest.php
@@ -15,18 +15,14 @@ class BesselITest extends TestCase
{
const BESSEL_PRECISION = 1E-9;
- /**
- * @dataProvider providerBESSELI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')]
public function testDirectCallToBESSELI(mixed $expectedResult, mixed ...$args): void
{
$result = BesselI::besselI(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')]
public function testBESSELIAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class BesselITest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELI')]
public function testBESSELIInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class BesselITest extends TestCase
return require 'tests/data/Calculation/Engineering/BESSELI.php';
}
- /**
- * @dataProvider providerUnhappyBESSELI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELI')]
public function testBESSELIUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -92,9 +84,7 @@ class BesselITest extends TestCase
];
}
- /**
- * @dataProvider providerBesselIArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselIArray')]
public function testBesselIArray(array $expectedResult, string $value, string $ord): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php
index ce8930505..a4b3b1dd0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselJTest.php
@@ -15,18 +15,14 @@ class BesselJTest extends TestCase
{
const BESSEL_PRECISION = 1E-8;
- /**
- * @dataProvider providerBESSELJ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')]
public function testDirectCallToBESSELJ(mixed $expectedResult, mixed ...$args): void
{
$result = BesselJ::besselJ(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELJ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')]
public function testBESSELJAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class BesselJTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELJ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELJ')]
public function testBESSELJInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class BesselJTest extends TestCase
return require 'tests/data/Calculation/Engineering/BESSELJ.php';
}
- /**
- * @dataProvider providerUnhappyBESSELJ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELJ')]
public function testBESSELJUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -92,9 +84,7 @@ class BesselJTest extends TestCase
];
}
- /**
- * @dataProvider providerBesselJArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselJArray')]
public function testBesselJArray(array $expectedResult, string $value, string $ord): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php
index 8a17b5c82..a810c3133 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselKTest.php
@@ -15,18 +15,14 @@ class BesselKTest extends TestCase
{
const BESSEL_PRECISION = 1E-12;
- /**
- * @dataProvider providerBESSELK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')]
public function testDirectCallToBESSELK(mixed $expectedResult, mixed ...$args): void
{
$result = BesselK::besselK(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')]
public function testBESSELKAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class BesselKTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELK')]
public function testBESSELKInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class BesselKTest extends TestCase
return require 'tests/data/Calculation/Engineering/BESSELK.php';
}
- /**
- * @dataProvider providerUnhappyBESSELK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELK')]
public function testBESSELKUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -92,9 +84,7 @@ class BesselKTest extends TestCase
];
}
- /**
- * @dataProvider providerBesselKArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselKArray')]
public function testBesselKArray(array $expectedResult, string $value, string $ord): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php
index 598cd95a7..bbd9e58d2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BesselYTest.php
@@ -15,18 +15,14 @@ class BesselYTest extends TestCase
{
const BESSEL_PRECISION = 1E-12;
- /**
- * @dataProvider providerBESSELY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')]
public function testDirectCallToBESSELY(mixed $expectedResult, mixed ...$args): void
{
$result = BesselY::besselY(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')]
public function testBESSELYAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class BesselYTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::BESSEL_PRECISION);
}
- /**
- * @dataProvider providerBESSELY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBESSELY')]
public function testBESSELYInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class BesselYTest extends TestCase
return require 'tests/data/Calculation/Engineering/BESSELY.php';
}
- /**
- * @dataProvider providerUnhappyBESSELY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBESSELY')]
public function testBESSELYUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -92,9 +84,7 @@ class BesselYTest extends TestCase
];
}
- /**
- * @dataProvider providerBesselYArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBesselYArray')]
public function testBesselYArray(array $expectedResult, string $value, string $ord): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php
index 1f4c1ad37..afcbb9a0c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2DecTest.php
@@ -27,9 +27,7 @@ class Bin2DecTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerBIN2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2DEC')]
public function testDirectCallToBIN2DEC(string $expectedResult, bool|int|string $arg1): void
{
$result = ConvertBinary::toDecimal($arg1);
@@ -41,9 +39,7 @@ class Bin2DecTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerBIN2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2DEC')]
public function testBIN2DECAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Bin2DecTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerBIN2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2DEC')]
public function testBIN2DECInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Bin2DecTest extends TestCase
return require 'tests/data/Calculation/Engineering/BIN2DEC.php';
}
- /**
- * @dataProvider providerUnhappyBIN2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBIN2DEC')]
public function testBIN2DECUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Bin2DecTest extends TestCase
];
}
- /**
- * @dataProvider providerBIN2DECOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2DECOds')]
public function testBIN2DECOds(string $expectedResult, bool $arg1): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Bin2DecTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerBin2DecArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBin2DecArray')]
public function testBin2DecArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php
index b2cf5bc40..8afcdf661 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2HexTest.php
@@ -27,9 +27,7 @@ class Bin2HexTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerBIN2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')]
public function testDirectCallToBIN2HEX(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
$result = ($digits === null) ? ConvertBinary::toHex($value) : ConvertBinary::toHex($value, $digits);
@@ -41,9 +39,7 @@ class Bin2HexTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerBIN2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')]
public function testBIN2HEXAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Bin2HexTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerBIN2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEX')]
public function testBIN2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Bin2HexTest extends TestCase
return require 'tests/data/Calculation/Engineering/BIN2HEX.php';
}
- /**
- * @dataProvider providerUnhappyBIN2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBIN2HEX')]
public function testBIN2HEXUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Bin2HexTest extends TestCase
];
}
- /**
- * @dataProvider providerBIN2HEXOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2HEXOds')]
public function testBIN2HEXOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Bin2HexTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerBin2HexArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBin2HexArray')]
public function testBin2HexArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php
index f0db0c1fb..2c320f488 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Bin2OctTest.php
@@ -27,9 +27,7 @@ class Bin2OctTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerBIN2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')]
public function testDirectCallToBIN2OCT(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
$result = ($digits === null) ? ConvertBinary::toOctal($value) : ConvertBinary::toOctal($value, $digits);
@@ -41,9 +39,7 @@ class Bin2OctTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerBIN2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')]
public function testBIN2OCTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Bin2OctTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerBIN2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCT')]
public function testBIN2OCTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Bin2OctTest extends TestCase
return require 'tests/data/Calculation/Engineering/BIN2OCT.php';
}
- /**
- * @dataProvider providerUnhappyBIN2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBIN2OCT')]
public function testBIN2OCTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Bin2OctTest extends TestCase
];
}
- /**
- * @dataProvider providerBIN2OCTOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBIN2OCTOds')]
public function testBIN2OCTOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Bin2OctTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerBin2OctArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBin2OctArray')]
public function testBin2OctArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php
index 1f913cbed..4ad529b26 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitAndTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class BitAndTest extends TestCase
{
- /**
- * @dataProvider providerBITAND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')]
public function testDirectCallToBITAND(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void
{
$result = BitWise::BITAND($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITAND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')]
public function testBITANDAsFormula(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class BitAndTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITAND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITAND')]
public function testBITANDInWorksheet(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class BitAndTest extends TestCase
return require 'tests/data/Calculation/Engineering/BITAND.php';
}
- /**
- * @dataProvider providerUnhappyBITAND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITAND')]
public function testBITANDUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class BitAndTest extends TestCase
];
}
- /**
- * @dataProvider providerBitAndArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBitAndArray')]
public function testBitAndArray(array $expectedResult, string $number1, string $number2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php
index a0bd6b758..82d1f749d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitLShiftTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class BitLShiftTest extends TestCase
{
- /**
- * @dataProvider providerBITLSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')]
public function testDirectCallToBITLSHIFT(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void
{
$result = BitWise::BITLSHIFT($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITLSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')]
public function testBITLSHIFTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class BitLShiftTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITLSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITLSHIFT')]
public function testBITLSHIFTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class BitLShiftTest extends TestCase
return require 'tests/data/Calculation/Engineering/BITLSHIFT.php';
}
- /**
- * @dataProvider providerUnhappyBITLSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITLSHIFT')]
public function testBITLSHIFTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class BitLShiftTest extends TestCase
];
}
- /**
- * @dataProvider providerBitLShiftArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBitLShiftArray')]
public function testBitLShiftArray(array $expectedResult, string $number, string $bits): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php
index f27f731f3..6cc139019 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitOrTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class BitOrTest extends TestCase
{
- /**
- * @dataProvider providerBITOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')]
public function testDirectCallToBITOR(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void
{
$result = BitWise::BITOR($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')]
public function testBITORAsFormula(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class BitOrTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITOR')]
public function testBITORInWorksheet(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class BitOrTest extends TestCase
return require 'tests/data/Calculation/Engineering/BITOR.php';
}
- /**
- * @dataProvider providerUnhappyBITOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITOR')]
public function testBITORUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class BitOrTest extends TestCase
];
}
- /**
- * @dataProvider providerBitOrArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBitOrArray')]
public function testBitOrArray(array $expectedResult, string $number1, string $number2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php
index e68173e36..084932a6b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitRShiftTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class BitRShiftTest extends TestCase
{
- /**
- * @dataProvider providerBITRSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')]
public function testDirectCallToBITRSHIFT(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void
{
$result = BitWise::BITRSHIFT($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITRSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')]
public function testBITRSHIFTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class BitRShiftTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITRSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITRSHIFT')]
public function testBITRSHIFTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class BitRShiftTest extends TestCase
return require 'tests/data/Calculation/Engineering/BITRSHIFT.php';
}
- /**
- * @dataProvider providerUnhappyBITRSHIFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITRSHIFT')]
public function testBITRSHIFTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class BitRShiftTest extends TestCase
];
}
- /**
- * @dataProvider providerBitRShiftArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBitRShiftArray')]
public function testBitRShiftArray(array $expectedResult, string $number, string $bits): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php
index 1c42c0f04..38b59b59d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/BitXorTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class BitXorTest extends TestCase
{
- /**
- * @dataProvider providerBITXOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')]
public function testDirectCallToBITXOR(float|int|string $expectedResult, null|bool|int|float|string $arg1, null|bool|int|float|string $arg2): void
{
$result = BitWise::BITXOR($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITXOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')]
public function testBITXORAsFormula(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class BitXorTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerBITXOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBITXOR')]
public function testBITXORInWorksheet(float|int|string $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class BitXorTest extends TestCase
return require 'tests/data/Calculation/Engineering/BITXOR.php';
}
- /**
- * @dataProvider providerUnhappyBITXOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyBITXOR')]
public function testBITXORUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +82,7 @@ class BitXorTest extends TestCase
];
}
- /**
- * @dataProvider providerBitXorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBitXorArray')]
public function testBitXorArray(array $expectedResult, string $number1, string $number2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php
index 17954601b..1a5933e34 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ComplexTest.php
@@ -12,9 +12,7 @@ use PHPUnit\Framework\TestCase;
class ComplexTest extends TestCase
{
- /**
- * @dataProvider providerCOMPLEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')]
public function testDirectCallToCOMPLEX(mixed $expectedResult, mixed ...$args): void
{
$result = Complex::complex(...$args);
@@ -26,9 +24,7 @@ class ComplexTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerCOMPLEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')]
public function testCOMPLEXAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -41,9 +37,7 @@ class ComplexTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerCOMPLEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMPLEX')]
public function testCOMPLEXInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -66,9 +60,7 @@ class ComplexTest extends TestCase
return require 'tests/data/Calculation/Engineering/COMPLEX.php';
}
- /**
- * @dataProvider providerComplexArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerComplexArray')]
public function testComplexArray(array $expectedResult, string $real, string $imaginary): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php
index e8044792a..ad30125d9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php
@@ -51,18 +51,14 @@ class ConvertUoMTest extends TestCase
self::assertSame(['multiplier' => 1024, 'name' => 'kibi'], $result['ki']);
}
- /**
- * @dataProvider providerCONVERTUOM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONVERTUOM')]
public function testDirectCallToCONVERTUOM(float|int|string $expectedResult, float|int|string $value, string $from, string $to): void
{
$result = ConvertUOM::convert($value, $from, $to);
self::assertEqualsWithDelta($expectedResult, $result, self::UOM_PRECISION);
}
- /**
- * @dataProvider providerCONVERTUOM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONVERTUOM')]
public function testCONVERTUOMAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -74,9 +70,7 @@ class ConvertUoMTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::UOM_PRECISION);
}
- /**
- * @dataProvider providerCONVERTUOM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONVERTUOM')]
public function testCONVERTUOMInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -99,9 +93,7 @@ class ConvertUoMTest extends TestCase
return require 'tests/data/Calculation/Engineering/CONVERTUOM.php';
}
- /**
- * @dataProvider providerUnhappyCONVERTUOM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyCONVERTUOM')]
public function testCONVERTUOMUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -129,9 +121,7 @@ class ConvertUoMTest extends TestCase
];
}
- /**
- * @dataProvider providerConvertUoMArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertUoMArray')]
public function testConvertUoMArray(array $expectedResult, string $value, string $fromUoM, string $toUoM): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php
index 51f73261f..cdee5b47f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2BinTest.php
@@ -26,9 +26,7 @@ class Dec2BinTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerDEC2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')]
public function testDirectCallToDEC2BIN(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
$result = ($digits === null) ? ConvertDecimal::toBinary($value) : ConvertDecimal::toBinary($value, $digits);
@@ -40,9 +38,7 @@ class Dec2BinTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerDEC2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')]
public function testDEC2BINAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -55,9 +51,7 @@ class Dec2BinTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerDEC2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BIN')]
public function testDEC2BINInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -80,9 +74,7 @@ class Dec2BinTest extends TestCase
return require 'tests/data/Calculation/Engineering/DEC2BIN.php';
}
- /**
- * @dataProvider providerUnhappyDEC2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2BIN')]
public function testDEC2BINUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -108,9 +100,7 @@ class Dec2BinTest extends TestCase
];
}
- /**
- * @dataProvider providerDEC2BINOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2BINOds')]
public function testDEC2BINOds(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -145,9 +135,7 @@ class Dec2BinTest extends TestCase
self::assertSame('101', $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerDec2BinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2BinArray')]
public function testDec2BinArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php
index 2be971d81..03a129b06 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2HexTest.php
@@ -26,9 +26,7 @@ class Dec2HexTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerDEC2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')]
public function testDirectCallToDEC2HEX(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
$result = ($digits === null) ? ConvertDecimal::toHex($value) : ConvertDecimal::toHex($value, $digits);
@@ -40,9 +38,7 @@ class Dec2HexTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerDEC2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')]
public function testDEC2HEXAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -55,9 +51,7 @@ class Dec2HexTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerDEC2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEX')]
public function testDEC2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -80,9 +74,7 @@ class Dec2HexTest extends TestCase
return require 'tests/data/Calculation/Engineering/DEC2HEX.php';
}
- /**
- * @dataProvider providerUnhappyDEC2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2HEX')]
public function testDEC2HEXUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -108,9 +100,7 @@ class Dec2HexTest extends TestCase
];
}
- /**
- * @dataProvider providerDEC2HEXOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2HEXOds')]
public function testDEC2HEXOds(mixed $expectedResult, bool|float|int|string $value, null|float|int|string $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -152,9 +142,7 @@ class Dec2HexTest extends TestCase
self::assertEquals('FFFFFFFFFF', ConvertDecimal::hex32bit(-1, 'FFFFFFFF', true));
}
- /**
- * @dataProvider providerDec2HexArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2HexArray')]
public function testDec2HexArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php
index 320710701..b99fa9e27 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Dec2OctTest.php
@@ -26,9 +26,7 @@ class Dec2OctTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerDEC2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')]
public function testDirectCallToDEC2OCT(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
$result = ($digits === null) ? ConvertDecimal::toOctal($value) : ConvertDecimal::toOctal($value, $digits);
@@ -40,9 +38,7 @@ class Dec2OctTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerDEC2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')]
public function testDEC2OCTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -55,9 +51,7 @@ class Dec2OctTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerDEC2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCT')]
public function testDEC2OCTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -80,9 +74,7 @@ class Dec2OctTest extends TestCase
return require 'tests/data/Calculation/Engineering/DEC2OCT.php';
}
- /**
- * @dataProvider providerUnhappyDEC2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDEC2OCT')]
public function testDEC2OCTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -108,9 +100,7 @@ class Dec2OctTest extends TestCase
];
}
- /**
- * @dataProvider providerDEC2OCTOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEC2OCTOds')]
public function testDEC2OCTOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -145,9 +135,7 @@ class Dec2OctTest extends TestCase
self::assertSame('21', $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerDec2OctArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDec2OctArray')]
public function testDec2OctArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php
index 6dbd164ec..54c0eb8f1 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/DeltaTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class DeltaTest extends TestCase
{
- /**
- * @dataProvider providerDELTA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDELTA')]
public function testDirectCallToDELTA(mixed $expectedResult, bool|float|int|string $arg1, null|bool|float|int|string $arg2 = null): void
{
$result = ($arg2 === null) ? Compare::delta($arg1) : Compare::delta($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDELTA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDELTA')]
public function testDELTAAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class DeltaTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerDELTA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDELTA')]
public function testDELTAInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class DeltaTest extends TestCase
return require 'tests/data/Calculation/Engineering/DELTA.php';
}
- /**
- * @dataProvider providerUnhappyDELTA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyDELTA')]
public function testDELTAUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class DeltaTest extends TestCase
];
}
- /**
- * @dataProvider providerDeltaArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDeltaArray')]
public function testDeltaArray(array $expectedResult, string $a, string $b): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php
index 515fe9e8f..2b4927c0e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php
@@ -15,18 +15,14 @@ class ErfCTest extends TestCase
{
const ERF_PRECISION = 1E-14;
- /**
- * @dataProvider providerERFC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFC')]
public function testDirectCallToERFC(mixed $expectedResult, mixed ...$args): void
{
$result = ErfC::ERFC(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERFC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFC')]
public function testERFCAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class ErfCTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERFC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFC')]
public function testERFCInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class ErfCTest extends TestCase
return require 'tests/data/Calculation/Engineering/ERFC.php';
}
- /**
- * @dataProvider providerUnhappyERFC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyERFC')]
public function testERFCUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -91,9 +83,7 @@ class ErfCTest extends TestCase
];
}
- /**
- * @dataProvider providerErfCArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerErfCArray')]
public function testErfCArray(array $expectedResult, string $lower): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php
index edc59284a..1dd8ab8de 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php
@@ -14,18 +14,14 @@ class ErfPreciseTest extends TestCase
{
const ERF_PRECISION = 1E-14;
- /**
- * @dataProvider providerERFPRECISE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFPRECISE')]
public function testDirectCallToERFPRECISE(mixed $expectedResult, mixed ...$args): void
{
$result = Erf::ERFPRECISE(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERFPRECISE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFPRECISE')]
public function testERFPRECISEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -37,9 +33,7 @@ class ErfPreciseTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERFPRECISE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERFPRECISE')]
public function testERFPRECISEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -62,9 +56,7 @@ class ErfPreciseTest extends TestCase
return require 'tests/data/Calculation/Engineering/ERFPRECISE.php';
}
- /**
- * @dataProvider providerErfPreciseArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerErfPreciseArray')]
public function testErfPreciseArray(array $expectedResult, string $limit): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php
index e9d239238..7fd9bcb33 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php
@@ -15,18 +15,14 @@ class ErfTest extends TestCase
{
const ERF_PRECISION = 1E-14;
- /**
- * @dataProvider providerERF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERF')]
public function testDirectCallToERF(mixed $expectedResult, mixed ...$args): void
{
$result = Erf::erf(...$args);
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERF')]
public function testERFAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class ErfTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::ERF_PRECISION);
}
- /**
- * @dataProvider providerERF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerERF')]
public function testERFInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class ErfTest extends TestCase
return require 'tests/data/Calculation/Engineering/ERF.php';
}
- /**
- * @dataProvider providerUnhappyERF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyERF')]
public function testERFUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -91,9 +83,7 @@ class ErfTest extends TestCase
];
}
- /**
- * @dataProvider providerErfArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerErfArray')]
public function testErfArray(array $expectedResult, string $lower, string $upper = 'NULL'): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php
index 34b42ceae..f39a8cbdf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/GeStepTest.php
@@ -13,18 +13,14 @@ use PHPUnit\Framework\TestCase;
class GeStepTest extends TestCase
{
- /**
- * @dataProvider providerGESTEP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGESTEP')]
public function testDirectCallToGESTEP(int|string $expectedResult, bool|float|int|string $arg1, null|bool|float|int|string $arg2 = null): void
{
$result = ($arg2 === null) ? Compare::geStep($arg1) : Compare::geStep($arg1, $arg2);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerGESTEP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGESTEP')]
public function testGESTEPAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -36,9 +32,7 @@ class GeStepTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerGESTEP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGESTEP')]
public function testGESTEPInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -61,9 +55,7 @@ class GeStepTest extends TestCase
return require 'tests/data/Calculation/Engineering/GESTEP.php';
}
- /**
- * @dataProvider providerUnhappyGESTEP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyGESTEP')]
public function testGESTEPUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -89,9 +81,7 @@ class GeStepTest extends TestCase
];
}
- /**
- * @dataProvider providerGeStepArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGeStepArray')]
public function testGeStepArray(array $expectedResult, string $a, string $b): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php
index bcd263235..abbe31712 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2BinTest.php
@@ -27,9 +27,7 @@ class Hex2BinTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerHEX2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2BIN')]
public function testDirectCallToHEX2BIN(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
$result = ($digits === null) ? ConvertHex::toBinary($value) : ConvertHex::toBinary($value, $digits);
@@ -41,9 +39,7 @@ class Hex2BinTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerHEX2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2BIN')]
public function testHEX2BINAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Hex2BinTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerHEX2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2BIN')]
public function testHEX2BINInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Hex2BinTest extends TestCase
return require 'tests/data/Calculation/Engineering/HEX2BIN.php';
}
- /**
- * @dataProvider providerUnhappyHEX2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyHEX2BIN')]
public function testHEX2BINUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Hex2BinTest extends TestCase
];
}
- /**
- * @dataProvider providerHEX2BINOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2BINOds')]
public function testHEX2BINOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Hex2BinTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerHex2BinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHex2BinArray')]
public function testHex2BinArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php
index 7586b43ea..888fba09d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2DecTest.php
@@ -27,9 +27,7 @@ class Hex2DecTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerHEX2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2DEC')]
public function testDirectCallToHEX2DEC(mixed $expectedResult, bool|float|int|string $value): void
{
$result = ConvertHex::toDecimal($value);
@@ -41,9 +39,7 @@ class Hex2DecTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerHEX2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2DEC')]
public function testHEX2DECAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Hex2DecTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerHEX2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2DEC')]
public function testHEX2DECInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Hex2DecTest extends TestCase
return require 'tests/data/Calculation/Engineering/HEX2DEC.php';
}
- /**
- * @dataProvider providerUnhappyHEX2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyHEX2DEC')]
public function testHEX2DECUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Hex2DecTest extends TestCase
];
}
- /**
- * @dataProvider providerHEX2DECOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2DECOds')]
public function testHEX2DECOds(mixed $expectedResult, bool|float|int|string $value): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Hex2DecTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerHex2DecArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHex2DecArray')]
public function testHex2DecArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php
index 603d4b2dc..ef02a41cb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Hex2OctTest.php
@@ -27,9 +27,7 @@ class Hex2OctTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerHEX2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2OCT')]
public function testDirectCallToHEX2OCT(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
$result = ($digits === null) ? ConvertHex::toOctal($value) : ConvertHex::toOctal($value, $digits);
@@ -41,9 +39,7 @@ class Hex2OctTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerHEX2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2OCT')]
public function testHEX2OCTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Hex2OctTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerHEX2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2OCT')]
public function testHEX2OCTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Hex2OctTest extends TestCase
return require 'tests/data/Calculation/Engineering/HEX2OCT.php';
}
- /**
- * @dataProvider providerUnhappyHEX2OCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyHEX2OCT')]
public function testHEX2OCTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Hex2OctTest extends TestCase
];
}
- /**
- * @dataProvider providerHEX2OCTOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHEX2OCTOds')]
public function testHEX2OCTOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Hex2OctTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerHex2OctArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHex2OctArray')]
public function testHex2OctArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php
index 2325a3b13..b1029fa7c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImAbsTest.php
@@ -15,18 +15,14 @@ class ImAbsTest extends TestCase
{
const COMPLEX_PRECISION = 1E-12;
- /**
- * @dataProvider providerIMABS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMABS')]
public function testDirectCallToIMABS(float|int|string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMABS($arg);
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMABS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMABS')]
public function testIMABSAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -38,9 +34,7 @@ class ImAbsTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMABS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMABS')]
public function testIMABSInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -63,9 +57,7 @@ class ImAbsTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMABS.php';
}
- /**
- * @dataProvider providerUnhappyIMABS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMABS')]
public function testIMABSUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -91,9 +83,7 @@ class ImAbsTest extends TestCase
];
}
- /**
- * @dataProvider providerImAbsArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImAbsArray')]
public function testImAbsArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php
index 6b15ddaf9..e701d5a30 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImArgumentTest.php
@@ -21,18 +21,14 @@ class ImArgumentTest extends TestCase
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
- /**
- * @dataProvider providerIMARGUMENT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMARGUMENT')]
public function testDirectCallToIMARGUMENT(float|int|string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMARGUMENT($arg);
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMARGUMENT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMARGUMENT')]
public function testIMARGUMENTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -44,9 +40,7 @@ class ImArgumentTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMARGUMENT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMARGUMENT')]
public function testIMARGUMENTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -69,9 +63,7 @@ class ImArgumentTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMARGUMENT.php';
}
- /**
- * @dataProvider providerUnhappyIMARGUMENT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMARGUMENT')]
public function testIMARGUMENTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php
index 213331eb5..d3588c756 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImConjugateTest.php
@@ -25,9 +25,7 @@ class ImConjugateTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCONJUGATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCONJUGATE')]
public function testDirectCallToIMCONJUGATE(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCONJUGATE($arg);
@@ -42,9 +40,7 @@ class ImConjugateTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCONJUGATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCONJUGATE')]
public function testIMCONJUGATEAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImConjugateTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCONJUGATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCONJUGATE')]
public function testIMCONJUGATEInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImConjugateTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCONJUGATE.php';
}
- /**
- * @dataProvider providerUnhappyIMCONJUGATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCONJUGATE')]
public function testIMCONJUGATEUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImConjugateTest extends TestCase
];
}
- /**
- * @dataProvider providerImConjugateArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImConjugateArray')]
public function testImConjugateArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php
index ef7332f32..77b2e61db 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCosTest.php
@@ -25,9 +25,7 @@ class ImCosTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCOS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOS')]
public function testDirectCallToIMCOS(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCOS($arg);
@@ -42,9 +40,7 @@ class ImCosTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCOS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOS')]
public function testIMCOSAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImCosTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCOS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOS')]
public function testIMCOSInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImCosTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCOS.php';
}
- /**
- * @dataProvider providerUnhappyIMCOS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCOS')]
public function testIMCOSUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImCosTest extends TestCase
];
}
- /**
- * @dataProvider providerImCosArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImCosArray')]
public function testImCosArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php
index a972e7d1f..be3532cce 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCoshTest.php
@@ -25,9 +25,7 @@ class ImCoshTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCOSH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOSH')]
public function testDirectCallToIMCOSH(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCOSH($arg);
@@ -42,9 +40,7 @@ class ImCoshTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCOSH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOSH')]
public function testIMCOSHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImCoshTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCOSH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOSH')]
public function testIMCOSHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImCoshTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCOSH.php';
}
- /**
- * @dataProvider providerUnhappyIMCOSH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCOSH')]
public function testIMCOSHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImCoshTest extends TestCase
];
}
- /**
- * @dataProvider providerImCoshArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImCoshArray')]
public function testImCoshArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php
index 97f88b604..3cba95456 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCotTest.php
@@ -25,9 +25,7 @@ class ImCotTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOT')]
public function testDirectCallToIMCOT(float|string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCOT($arg);
@@ -42,9 +40,7 @@ class ImCotTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOT')]
public function testIMCOTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImCotTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCOT')]
public function testIMCOTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImCotTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCOT.php';
}
- /**
- * @dataProvider providerUnhappyIMCOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCOT')]
public function testIMCOTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImCotTest extends TestCase
];
}
- /**
- * @dataProvider providerImCotArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImCotArray')]
public function testImCotArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php
index d694bc9d7..83cc422dc 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCscTest.php
@@ -25,9 +25,7 @@ class ImCscTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCSC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')]
public function testDirectCallToIMCSC(float|string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCSC($arg);
@@ -42,9 +40,7 @@ class ImCscTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCSC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')]
public function testIMCSCAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImCscTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCSC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSC')]
public function testIMCSCInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImCscTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCSC.php';
}
- /**
- * @dataProvider providerUnhappyIMCSC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCSC')]
public function testIMCSCUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImCscTest extends TestCase
];
}
- /**
- * @dataProvider providerImCscArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImCscArray')]
public function testImCscArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php
index cf1a88817..834fa2a0f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImCschTest.php
@@ -25,9 +25,7 @@ class ImCschTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMCSCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSCH')]
public function testDirectCallToIMCSCH(float|string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMCSCH($arg);
@@ -42,9 +40,7 @@ class ImCschTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMCSCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSCH')]
public function testIMCSCHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImCschTest extends TestCase
);
}
- /**
- * @dataProvider providerIMCSCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMCSCH')]
public function testIMCSCHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImCschTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMCSCH.php';
}
- /**
- * @dataProvider providerUnhappyIMCSCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMCSCH')]
public function testIMCSCHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImCschTest extends TestCase
];
}
- /**
- * @dataProvider providerImCschArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImCschArray')]
public function testImCschArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php
index 9c73efa81..5c709752b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImDivTest.php
@@ -25,9 +25,7 @@ class ImDivTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMDIV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMDIV')]
public function testDirectCallToIMDIV(string $expectedResult, string $dividend, string $divisor): void
{
$result = ComplexOperations::IMDIV($dividend, $divisor);
@@ -42,9 +40,7 @@ class ImDivTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMDIV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMDIV')]
public function testIMDIVAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImDivTest extends TestCase
);
}
- /**
- * @dataProvider providerIMDIV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMDIV')]
public function testIMDIVInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImDivTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMDIV.php';
}
- /**
- * @dataProvider providerUnhappyIMDIV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMDIV')]
public function testIMDIVUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -117,9 +109,7 @@ class ImDivTest extends TestCase
];
}
- /**
- * @dataProvider providerImDivArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImDivArray')]
public function testImDivArray(array $expectedResult, string $dividend, string $divisor): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php
index 23541b2cc..c9b480fb8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImExpTest.php
@@ -25,9 +25,7 @@ class ImExpTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMEXP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMEXP')]
public function testDirectCallToIMEXP(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMEXP($arg);
@@ -42,9 +40,7 @@ class ImExpTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMEXP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMEXP')]
public function testIMEXPAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImExpTest extends TestCase
);
}
- /**
- * @dataProvider providerIMEXP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMEXP')]
public function testIMEXPInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImExpTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMEXP.php';
}
- /**
- * @dataProvider providerUnhappyIMEXP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMEXP')]
public function testIMEXPUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImExpTest extends TestCase
];
}
- /**
- * @dataProvider providerImExpArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImExpArray')]
public function testImExpArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php
index 655ae31c5..0e0c5a558 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLnTest.php
@@ -25,9 +25,7 @@ class ImLnTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLN')]
public function testDirectCallToIMLN(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMLN($arg);
@@ -42,9 +40,7 @@ class ImLnTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLN')]
public function testIMLNAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImLnTest extends TestCase
);
}
- /**
- * @dataProvider providerIMLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLN')]
public function testIMLNInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImLnTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMLN.php';
}
- /**
- * @dataProvider providerUnhappyIMLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMLN')]
public function testIMLNUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImLnTest extends TestCase
];
}
- /**
- * @dataProvider providerImLnArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImLnArray')]
public function testImLnArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php
index c7940c600..08d5a7ffa 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog10Test.php
@@ -25,9 +25,7 @@ class ImLog10Test extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMLOG10
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG10')]
public function testDirectCallToIMLOG10(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMLOG10($arg);
@@ -42,9 +40,7 @@ class ImLog10Test extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMLOG10
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG10')]
public function testIMLOG10AsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImLog10Test extends TestCase
);
}
- /**
- * @dataProvider providerIMLOG10
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG10')]
public function testIMLOG10InWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImLog10Test extends TestCase
return require 'tests/data/Calculation/Engineering/IMLOG10.php';
}
- /**
- * @dataProvider providerUnhappyIMLOG10
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMLOG10')]
public function testIMLOG10UnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImLog10Test extends TestCase
];
}
- /**
- * @dataProvider providerImLog10Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImLog10Array')]
public function testImLog10Array(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php
index 42ab29cf6..02e6cdbed 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImLog2Test.php
@@ -25,9 +25,7 @@ class ImLog2Test extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMLOG2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG2')]
public function testDirectCallToIMLOG2(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMLOG2($arg);
@@ -42,9 +40,7 @@ class ImLog2Test extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMLOG2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG2')]
public function testIMLOG2AsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImLog2Test extends TestCase
);
}
- /**
- * @dataProvider providerIMLOG2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMLOG2')]
public function testIMLOG2InWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImLog2Test extends TestCase
return require 'tests/data/Calculation/Engineering/IMLOG2.php';
}
- /**
- * @dataProvider providerUnhappyIMLOG2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMLOG2')]
public function testIMLOG2UnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImLog2Test extends TestCase
];
}
- /**
- * @dataProvider providerImLog2Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImLog2Array')]
public function testImLog2Array(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php
index 4a33ba6a3..edb3a1724 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImPowerTest.php
@@ -25,9 +25,7 @@ class ImPowerTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMPOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPOWER')]
public function testDirectCallToIMPOWER(float|int|string $expectedResult, string $arg1, float|int|string $arg2): void
{
$result = ComplexFunctions::IMPOWER($arg1, $arg2);
@@ -42,9 +40,7 @@ class ImPowerTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMPOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPOWER')]
public function testIMPOWERAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImPowerTest extends TestCase
);
}
- /**
- * @dataProvider providerIMPOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPOWER')]
public function testIMPOWERInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImPowerTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMPOWER.php';
}
- /**
- * @dataProvider providerUnhappyIMPOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMPOWER')]
public function testIMPOWERUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImPowerTest extends TestCase
];
}
- /**
- * @dataProvider providerImPowerArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImPowerArray')]
public function testImPowerArray(array $expectedResult, string $complex, string $real): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php
index 256498b71..fb7fc7f8d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImProductTest.php
@@ -26,10 +26,9 @@ class ImProductTest extends TestCase
}
/**
- * @dataProvider providerIMPRODUCT
- *
* @param string ...$args variadic arguments
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPRODUCT')]
public function testDirectCallToIMPRODUCT(mixed $expectedResult, ...$args): void
{
$result = ComplexOperations::IMPRODUCT(...$args);
@@ -44,9 +43,7 @@ class ImProductTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMPRODUCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPRODUCT')]
public function testIMPRODUCTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -62,9 +59,7 @@ class ImProductTest extends TestCase
);
}
- /**
- * @dataProvider providerIMPRODUCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMPRODUCT')]
public function testIMPRODUCTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +85,7 @@ class ImProductTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMPRODUCT.php';
}
- /**
- * @dataProvider providerUnhappyIMPRODUCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMPRODUCT')]
public function testIMPRODUCTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php
index 4cbc4a783..57ef95390 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImRealTest.php
@@ -21,18 +21,14 @@ class ImRealTest extends TestCase
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
- /**
- * @dataProvider providerIMREAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMREAL')]
public function testDirectCallToIMREAL(float|int|string $expectedResult, float|int|string $arg): void
{
$result = Complex::IMREAL((string) $arg);
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMREAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMREAL')]
public function testIMREALAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -44,9 +40,7 @@ class ImRealTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMREAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMREAL')]
public function testIMREALInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -69,9 +63,7 @@ class ImRealTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMREAL.php';
}
- /**
- * @dataProvider providerUnhappyIMREAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMREAL')]
public function testIMREALUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -97,9 +89,7 @@ class ImRealTest extends TestCase
];
}
- /**
- * @dataProvider providerImRealArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImRealArray')]
public function testImRealArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php
index 583b08494..d37552ab7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSecTest.php
@@ -25,9 +25,7 @@ class ImSecTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSEC')]
public function testDirectCallToIMSEC(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMSEC($arg);
@@ -42,9 +40,7 @@ class ImSecTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSEC')]
public function testIMSECAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSecTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSEC')]
public function testIMSECInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSecTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSEC.php';
}
- /**
- * @dataProvider providerUnhappyIMSEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSEC')]
public function testIMSECUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImSecTest extends TestCase
];
}
- /**
- * @dataProvider providerImSecArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSecArray')]
public function testImSecArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php
index c1840a427..808388058 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSechTest.php
@@ -25,9 +25,7 @@ class ImSechTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSECH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSECH')]
public function testDirectCallToIMSECH(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMSECH($arg);
@@ -42,9 +40,7 @@ class ImSechTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSECH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSECH')]
public function testIMSECHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSechTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSECH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSECH')]
public function testIMSECHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSechTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSECH.php';
}
- /**
- * @dataProvider providerUnhappyIMSECH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSECH')]
public function testIMSECHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImSechTest extends TestCase
];
}
- /**
- * @dataProvider providerImSecHArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSecHArray')]
public function testImSecHArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php
index 347d522e1..e413da1e8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinTest.php
@@ -25,9 +25,7 @@ class ImSinTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSIN')]
public function testDirectCallToIMSIN(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMSIN($arg);
@@ -42,9 +40,7 @@ class ImSinTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSIN')]
public function testIMSINAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSinTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSIN')]
public function testIMSINInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSinTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSIN.php';
}
- /**
- * @dataProvider providerUnhappyIMSIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSIN')]
public function testIMSINUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImSinTest extends TestCase
];
}
- /**
- * @dataProvider providerImSinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSinArray')]
public function testImSinArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php
index 4198033fa..99b6b6245 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSinhTest.php
@@ -25,9 +25,7 @@ class ImSinhTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSINH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSINH')]
public function testDirectCallToIMSINH(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMSINH($arg);
@@ -42,9 +40,7 @@ class ImSinhTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSINH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSINH')]
public function testIMSINHAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSinhTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSINH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSINH')]
public function testIMSINHInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSinhTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSINH.php';
}
- /**
- * @dataProvider providerUnhappyIMSINH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSINH')]
public function testIMSINHUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImSinhTest extends TestCase
];
}
- /**
- * @dataProvider providerImSinHArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSinHArray')]
public function testImSinHArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php
index 7edf1e032..08ee4b78b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSqrtTest.php
@@ -25,9 +25,7 @@ class ImSqrtTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSQRT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')]
public function testDirectCallToIMSQRT(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMSQRT($arg);
@@ -42,9 +40,7 @@ class ImSqrtTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSQRT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')]
public function testIMSQRTAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSqrtTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSQRT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSQRT')]
public function testIMSQRTInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSqrtTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSQRT.php';
}
- /**
- * @dataProvider providerUnhappyIMSQRT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSQRT')]
public function testIMSQRTUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImSqrtTest extends TestCase
];
}
- /**
- * @dataProvider providerImSqrtArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSqrtArray')]
public function testImSqrtArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php
index ff95604ed..cfcd5d3bd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSubTest.php
@@ -25,9 +25,7 @@ class ImSubTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMSUB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')]
public function testDirectCallToIMSUB(string $expectedResult, string $arg1, string $arg2): void
{
$result = ComplexOperations::IMSUB($arg1, $arg2);
@@ -42,9 +40,7 @@ class ImSubTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSUB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')]
public function testIMSUBAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImSubTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSUB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUB')]
public function testIMSUBInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImSubTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSUB.php';
}
- /**
- * @dataProvider providerUnhappyIMSUB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSUB')]
public function testIMSUBUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -117,9 +109,7 @@ class ImSubTest extends TestCase
];
}
- /**
- * @dataProvider providerImSubArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImSubArray')]
public function testImSubArray(array $expectedResult, string $subidend, string $subisor): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php
index 625348de6..dbf6a7463 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImSumTest.php
@@ -26,10 +26,9 @@ class ImSumTest extends TestCase
}
/**
- * @dataProvider providerIMSUM
- *
* @param string ...$args variadic arguments
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')]
public function testDirectCallToIMSUM(mixed $expectedResult, ...$args): void
{
$result = ComplexOperations::IMSUM(...$args);
@@ -44,9 +43,7 @@ class ImSumTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMSUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')]
public function testIMSUMAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -62,9 +59,7 @@ class ImSumTest extends TestCase
);
}
- /**
- * @dataProvider providerIMSUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMSUM')]
public function testIMSUMInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -90,9 +85,7 @@ class ImSumTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMSUM.php';
}
- /**
- * @dataProvider providerUnhappyIMSUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMSUM')]
public function testIMSUMUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php
index 949e42a64..b4d5af1b8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImTanTest.php
@@ -25,9 +25,7 @@ class ImTanTest extends TestCase
$this->complexAssert = new ComplexAssert();
}
- /**
- * @dataProvider providerIMTAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')]
public function testDirectCallToIMTAN(string $expectedResult, string $arg): void
{
$result = ComplexFunctions::IMTAN($arg);
@@ -42,9 +40,7 @@ class ImTanTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerIMTAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')]
public function testIMTANAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -60,9 +56,7 @@ class ImTanTest extends TestCase
);
}
- /**
- * @dataProvider providerIMTAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMTAN')]
public function testIMTANInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -88,9 +82,7 @@ class ImTanTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMTAN.php';
}
- /**
- * @dataProvider providerUnhappyIMTAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMTAN')]
public function testIMTANUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -116,9 +108,7 @@ class ImTanTest extends TestCase
];
}
- /**
- * @dataProvider providerImTanArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImTanArray')]
public function testImTanArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php
index f62cc1d89..4f1f7b85e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ImaginaryTest.php
@@ -21,18 +21,14 @@ class ImaginaryTest extends TestCase
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
- /**
- * @dataProvider providerIMAGINARY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')]
public function testDirectCallToIMAGINARY(float|int|string $expectedResult, float|int|string $arg): void
{
$result = Complex::IMAGINARY((string) $arg);
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMAGINARY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')]
public function testIMAGINARYAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -44,9 +40,7 @@ class ImaginaryTest extends TestCase
self::assertEqualsWithDelta($expectedResult, $result, self::COMPLEX_PRECISION);
}
- /**
- * @dataProvider providerIMAGINARY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIMAGINARY')]
public function testIMAGINARYInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -69,9 +63,7 @@ class ImaginaryTest extends TestCase
return require 'tests/data/Calculation/Engineering/IMAGINARY.php';
}
- /**
- * @dataProvider providerUnhappyIMAGINARY
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyIMAGINARY')]
public function testIMAGINARYUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -97,9 +89,7 @@ class ImaginaryTest extends TestCase
];
}
- /**
- * @dataProvider providerImaginaryArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerImaginaryArray')]
public function testImaginaryArray(array $expectedResult, string $complex): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php
index 9e02a442f..be2aeaeaf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2BinTest.php
@@ -27,9 +27,7 @@ class Oct2BinTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerOCT2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')]
public function testDirectCallToOCT2BIN(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
$result = ($digits === null) ? ConvertOctal::toBinary($value) : ConvertOctal::toBinary($value, $digits);
@@ -41,9 +39,7 @@ class Oct2BinTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerOCT2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')]
public function testOCT2BINAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Oct2BinTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerOCT2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BIN')]
public function testOCT2BINInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Oct2BinTest extends TestCase
return require 'tests/data/Calculation/Engineering/OCT2BIN.php';
}
- /**
- * @dataProvider providerUnhappyOCT2BIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyOCT2BIN')]
public function testOCT2BINUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Oct2BinTest extends TestCase
];
}
- /**
- * @dataProvider providerOCT2BINOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2BINOds')]
public function testOCT2BINOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Oct2BinTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerOct2BinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOct2BinArray')]
public function testOct2BinArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php
index 45a868e6a..911aac805 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2DecTest.php
@@ -27,9 +27,7 @@ class Oct2DecTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerOCT2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2DEC')]
public function testDirectCallToOCT2DEC(mixed $expectedResult, bool|string $value): void
{
$result = ConvertOctal::toDecimal($value);
@@ -41,9 +39,7 @@ class Oct2DecTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerOCT2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2DEC')]
public function testOCT2DECAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Oct2DecTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerOCT2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2DEC')]
public function testOCT2DECInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Oct2DecTest extends TestCase
return require 'tests/data/Calculation/Engineering/OCT2DEC.php';
}
- /**
- * @dataProvider providerUnhappyOCT2DEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyOCT2DEC')]
public function testOCT2DECUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Oct2DecTest extends TestCase
];
}
- /**
- * @dataProvider providerOCT2DECOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2DECOds')]
public function testOCT2DECOds(mixed $expectedResult, bool|string $value): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Oct2DecTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerOct2DecArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOct2DecArray')]
public function testOct2DecArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php
index a350bd759..94da193a2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/Oct2HexTest.php
@@ -27,9 +27,7 @@ class Oct2HexTest extends TestCase
Functions::setCompatibilityMode($this->compatibilityMode);
}
- /**
- * @dataProvider providerOCT2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')]
public function testDirectCallToOCT2HEX(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
$result = ($digits === null) ? ConvertOctal::toHex($value) : ConvertOctal::toHex($value, $digits);
@@ -41,9 +39,7 @@ class Oct2HexTest extends TestCase
return trim($value, '"');
}
- /**
- * @dataProvider providerOCT2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')]
public function testOCT2HEXAsFormula(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -56,9 +52,7 @@ class Oct2HexTest extends TestCase
self::assertSame($expectedResult, $this->trimIfQuoted((string) $result));
}
- /**
- * @dataProvider providerOCT2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEX')]
public function testOCT2HEXInWorksheet(mixed $expectedResult, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -81,9 +75,7 @@ class Oct2HexTest extends TestCase
return require 'tests/data/Calculation/Engineering/OCT2HEX.php';
}
- /**
- * @dataProvider providerUnhappyOCT2HEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUnhappyOCT2HEX')]
public function testOCT2HEXUnhappyPath(string $expectedException, mixed ...$args): void
{
$arguments = new FormulaArguments(...$args);
@@ -109,9 +101,7 @@ class Oct2HexTest extends TestCase
];
}
- /**
- * @dataProvider providerOCT2HEXOds
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOCT2HEXOds')]
public function testOCT2HEXOds(mixed $expectedResult, bool|float|int|string $value, ?int $digits = null): void
{
Functions::setCompatibilityMode(Functions::COMPATIBILITY_OPENOFFICE);
@@ -146,9 +136,7 @@ class Oct2HexTest extends TestCase
self::assertSame(ExcelError::NAN(), $this->trimIfQuoted((string) $result), 'Excel');
}
- /**
- * @dataProvider providerOct2HexArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOct2HexArray')]
public function testOct2HexArray(array $expectedResult, string $value): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php
index 07f99cc2d..9889693ad 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintMTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class AccrintMTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerACCRINTM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerACCRINTM')]
public function testACCRINTM(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('ACCRINTM', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php
index 97bd742df..98bc0654f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AccrintTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class AccrintTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerACCRINT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerACCRINT')]
public function testACCRINT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('ACCRINT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorDegRcTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorDegRcTest.php
index 459b7674a..77153d396 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorDegRcTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorDegRcTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class AmorDegRcTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAMORDEGRC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAMORDEGRC')]
public function testAMORDEGRC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('AMORDEGRC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorLincTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorLincTest.php
index 95db9bc19..a963c38d8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorLincTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/AmorLincTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class AmorLincTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAMORLINC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAMORLINC')]
public function testAMORLINC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('AMORLINC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDayBsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDayBsTest.php
index 15633fd8e..3907f268a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDayBsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDayBsTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupDayBsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPDAYBS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPDAYBS')]
public function testCOUPDAYBS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPDAYBS', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysNcTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysNcTest.php
index 7696f61f8..848f763de 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysNcTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysNcTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupDaysNcTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPDAYSNC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPDAYSNC')]
public function testCOUPDAYSNC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPDAYSNC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysTest.php
index f7ba0e7be..6d5fe6d65 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupDaysTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupDaysTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPDAYS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPDAYS')]
public function testCOUPDAYS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPDAYS', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNcdTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNcdTest.php
index f3f04792f..fd88e6a3a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNcdTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNcdTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupNcdTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPNCD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPNCD')]
public function testCOUPNCD(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPNCD', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNumTest.php
index 86360ecb3..792ccad44 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupNumTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupNumTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPNUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPNUM')]
public function testCOUPNUM(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPNUM', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupPcdTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupPcdTest.php
index 8c02ea048..5566e6b73 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupPcdTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CoupPcdTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CoupPcdTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUPPCD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUPPCD')]
public function testCOUPPCD(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('COUPPCD', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumIpmtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumIpmtTest.php
index a27724ab8..7260f1b55 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumIpmtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumIpmtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CumIpmtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCUMIPMT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCUMIPMT')]
public function testCUMIPMT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('CUMIPMT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumPrincTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumPrincTest.php
index b241c2940..80059ca19 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumPrincTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/CumPrincTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class CumPrincTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCUMPRINC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCUMPRINC')]
public function testCUMPRINC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('CUMPRINC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DbTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DbTest.php
index 13856c048..6a39933ad 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DbTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DbTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class DbTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDB')]
public function testDB(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('DB', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DdbTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DdbTest.php
index 5e513ed64..fce33e5c6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DdbTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DdbTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class DdbTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDDB
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDDB')]
public function testDDB(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('DDB', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DiscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DiscTest.php
index 317854edc..48ce7159d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DiscTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DiscTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class DiscTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDISC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDISC')]
public function testDISC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('DISC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarDeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarDeTest.php
index c37937740..cd8b091d8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarDeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarDeTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class DollarDeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDOLLARDE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDOLLARDE')]
public function testDOLLARDE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('DOLLARDE', $expectedResult, $args);
@@ -21,9 +19,7 @@ class DollarDeTest extends AllSetupTeardown
return require 'tests/data/Calculation/Financial/DOLLARDE.php';
}
- /**
- * @dataProvider providerDollarDeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDollarDeArray')]
public function testDollarDeArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarFrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarFrTest.php
index 992b5a64e..c305ab9e8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarFrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/DollarFrTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class DollarFrTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDOLLARFR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDOLLARFR')]
public function testDOLLARFR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('DOLLARFR', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php
index 4811c64c3..049e3de5e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/EffectTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class EffectTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerEFFECT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEFFECT')]
public function testEFFECT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('EFFECT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvScheduleTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvScheduleTest.php
index bb72492f5..bc2c8b7a0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvScheduleTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvScheduleTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class FvScheduleTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFVSCHEDULE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFVSCHEDULE')]
public function testFVSCHEDULE(mixed $expectedResult, mixed $principal = null, ?array $schedule = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvTest.php
index 1dbfee1af..df0c5db07 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/FvTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class FvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFV')]
public function testFV(mixed $expectedResult, array $args): void
{
$this->runTestCase('FV', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php
index 1d5087034..4ccf358dd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/HelpersTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class HelpersTest extends TestCase
{
- /**
- * @dataProvider providerDaysPerYear
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDaysPerYear')]
public function testDaysPerYear(mixed $expectedResult, int $year, int|string $basis): void
{
$result = Helpers::daysPerYear($year, $basis);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IPmtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IPmtTest.php
index 75faf7927..46d611225 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IPmtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IPmtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class IPmtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIPMT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIPMT')]
public function testIPMT(mixed $expectedResult, array $args): void
{
$this->runTestCase('IPMT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IntRateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IntRateTest.php
index fc111f1cd..307f95f22 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IntRateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IntRateTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class IntRateTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerINTRATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINTRATE')]
public function testINTRATE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('INTRATE', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php
index 08d09c587..ade1cbe46 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class IrrTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIRR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIRR')]
public function testIRR(mixed $expectedResult, mixed $values = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IsPmtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IsPmtTest.php
index ea085fb50..2c460a1a0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IsPmtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IsPmtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class IsPmtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerISPMT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerISPMT')]
public function testISPMT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('ISPMT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MirrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MirrTest.php
index d2a65dd06..ebdf0ac1b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MirrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/MirrTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class MirrTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMIRR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMIRR')]
public function testMIRR(mixed $expectedResult, mixed $values, mixed $financeRate = null, mixed $reinvestRate = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NPerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NPerTest.php
index 302ad808f..8d36412b7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NPerTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NPerTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class NPerTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNPER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNPER')]
public function testNPER(mixed $expectedResult, array $args): void
{
$this->runTestCase('NPER', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php
index 302d5a0c1..df805207b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NominalTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class NominalTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNOMINAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNOMINAL')]
public function testNOMINAL(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('NOMINAL', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NpvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NpvTest.php
index c43d819bd..77e1efcb6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NpvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/NpvTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class NpvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNPV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNPV')]
public function testNPV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('NPV', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PDurationTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PDurationTest.php
index 7c31158e1..d4cc3095c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PDurationTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PDurationTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PDurationTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPDURATION
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPDURATION')]
public function testPDURATION(mixed $expectedResult, array $args): void
{
$this->runTestCase('PDURATION', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PmtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PmtTest.php
index ae3f6ea9f..c8adfb83a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PmtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PmtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PmtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPMT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPMT')]
public function testPMT(mixed $expectedResult, array $args): void
{
$this->runTestCase('PMT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PpmtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PpmtTest.php
index 820d315d8..dc3d795f6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PpmtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PpmtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PpmtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPPMT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPPMT')]
public function testPPMT(mixed $expectedResult, array $args): void
{
$this->runTestCase('PPMT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceDiscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceDiscTest.php
index 2abb6effb..065299bdb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceDiscTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceDiscTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PriceDiscTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPRICEDISC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPRICEDISC')]
public function testPRICEDISC(mixed $expectedResult, array $args): void
{
$this->runTestCase('PRICEDISC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceMatTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceMatTest.php
index a30c196b8..b275fc4bf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceMatTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceMatTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PriceMatTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPRICEMAT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPRICEMAT')]
public function testPRICEMAT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('PRICEMAT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceTest.php
index 56328f882..cb22ff8ca 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PriceTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PriceTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPRICE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPRICE')]
public function testPRICE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('PRICE', $expectedResult, $args);
@@ -19,9 +17,7 @@ class PriceTest extends AllSetupTeardown
return require 'tests/data/Calculation/Financial/PRICE.php';
}
- /**
- * @dataProvider providerPRICE3
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPRICE3')]
public function testPRICE3(mixed $expectedResult, mixed ...$args): void
{
// These results (PRICE function with basis codes 2 and 3)
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PvTest.php
index ffdb1e25b..d095d311b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/PvTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class PvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPV')]
public function testPV(mixed $expectedResult, array $args): void
{
$this->runTestCase('PV', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RateTest.php
index f36437395..02914cdf5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RateTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class RateTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRATE')]
public function testRATE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('RATE', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/ReceivedTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/ReceivedTest.php
index d5ac3000b..fd13f6a72 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/ReceivedTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/ReceivedTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class ReceivedTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRECEIVED
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRECEIVED')]
public function testRECEIVED(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('RECEIVED', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RriTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RriTest.php
index ccfd7587b..ea08d3772 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RriTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/RriTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class RriTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRRI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRRI')]
public function testRRI(mixed $expectedResult, array $args): void
{
$this->runTestCase('RRI', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SlnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SlnTest.php
index abe5a7a9c..3e67a673c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SlnTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SlnTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class SlnTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSLN')]
public function testSLN(mixed $expectedResult, array $args): void
{
$this->runTestCase('SLN', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SydTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SydTest.php
index 6b8561771..6a2534dbf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SydTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/SydTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class SydTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSYD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSYD')]
public function testSYD(mixed $expectedResult, array $args): void
{
$this->runTestCase('SYD', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillEqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillEqTest.php
index d18aa5285..e67358d1e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillEqTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillEqTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class TBillEqTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTBILLEQ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTBILLEQ')]
public function testTBILLEQ(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('TBILLEQ', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillPriceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillPriceTest.php
index c8778fc28..62ca8f1f8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillPriceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillPriceTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class TBillPriceTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTBILLPRICE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTBILLPRICE')]
public function testTBILLPRICE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('TBILLPRICE', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillYieldTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillYieldTest.php
index 30d58c327..807d22f9d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillYieldTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/TBillYieldTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class TBillYieldTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTBILLYIELD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTBILLYIELD')]
public function testTBILLYIELD(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('TBILLYIELD', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/UsDollarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/UsDollarTest.php
index 91714a169..3bb4af043 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/UsDollarTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/UsDollarTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class UsDollarTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerUSDOLLAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUSDOLLAR')]
public function testUSDOLLAR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('USDOLLAR', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XNpvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XNpvTest.php
index a94a9210d..65c2fce18 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XNpvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XNpvTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class XNpvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerXNPV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerXNPV')]
public function testXNPV(mixed $expectedResult, mixed $rate = null, mixed $values = null, mixed $dates = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XirrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XirrTest.php
index d48bd1b61..76275e8f9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XirrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/XirrTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class XirrTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerXIRR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerXIRR')]
public function testXIRR(mixed $expectedResult, mixed $values = null, mixed $dates = null, mixed $guess = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldDiscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldDiscTest.php
index 32f843174..cb5c25ca5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldDiscTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldDiscTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class YieldDiscTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerYIELDDISC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYIELDDISC')]
public function testYIELDDISC(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('YIELDDISC', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldMatTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldMatTest.php
index 28c554060..73c799cbc 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldMatTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Financial/YieldMatTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Financial;
class YieldMatTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerYIELDMAT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerYIELDMAT')]
public function testYIELDMAT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('YIELDMAT', $expectedResult, $args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/ErrorTypeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/ErrorTypeTest.php
index c0e9eb4d0..eae76a1a6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/ErrorTypeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/ErrorTypeTest.php
@@ -16,9 +16,7 @@ class ErrorTypeTest extends TestCase
self::assertSame(ExcelError::NA(), $result);
}
- /**
- * @dataProvider providerErrorType
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerErrorType')]
public function testErrorType(int|string $expectedResult, mixed $value): void
{
$result = ExcelError::type($value);
@@ -30,9 +28,7 @@ class ErrorTypeTest extends TestCase
return require 'tests/data/Calculation/Information/ERROR_TYPE.php';
}
- /**
- * @dataProvider providerErrorTypeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerErrorTypeArray')]
public function testErrorTypeArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsBlankTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsBlankTest.php
index 8a047a59e..495798fd6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsBlankTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsBlankTest.php
@@ -16,9 +16,7 @@ class IsBlankTest extends TestCase
self::assertTrue($result);
}
- /**
- * @dataProvider providerIsBlank
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsBlank')]
public function testIsBlank(bool $expectedResult, mixed $value): void
{
$result = Value::isBlank($value);
@@ -30,9 +28,7 @@ class IsBlankTest extends TestCase
return require 'tests/data/Calculation/Information/IS_BLANK.php';
}
- /**
- * @dataProvider providerIsBlankArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsBlankArray')]
public function testIsBlankArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrTest.php
index a24dde86f..5b93149fb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrTest.php
@@ -16,9 +16,7 @@ class IsErrTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsErr
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsErr')]
public function testIsErr(bool $expectedResult, mixed $value): void
{
$result = ErrorValue::isErr($value);
@@ -30,9 +28,7 @@ class IsErrTest extends TestCase
return require 'tests/data/Calculation/Information/IS_ERR.php';
}
- /**
- * @dataProvider providerIsErrArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsErrArray')]
public function testIsErrArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrorTest.php
index 765cb8e55..526a379cb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsErrorTest.php
@@ -16,9 +16,7 @@ class IsErrorTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsError
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsError')]
public function testIsError(bool $expectedResult, mixed $value): void
{
$result = ErrorValue::isError($value);
@@ -30,9 +28,7 @@ class IsErrorTest extends TestCase
return require 'tests/data/Calculation/Information/IS_ERROR.php';
}
- /**
- * @dataProvider providerIsErrorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsErrorArray')]
public function testIsErrorArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsEvenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsEvenTest.php
index 0ebf0ed05..c8293d6df 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsEvenTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsEvenTest.php
@@ -17,9 +17,7 @@ class IsEvenTest extends TestCase
self::assertSame(ExcelError::NAME(), $result);
}
- /**
- * @dataProvider providerIsEven
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsEven')]
public function testIsEven(bool|string $expectedResult, mixed $value): void
{
$result = Value::isEven($value);
@@ -31,9 +29,7 @@ class IsEvenTest extends TestCase
return require 'tests/data/Calculation/Information/IS_EVEN.php';
}
- /**
- * @dataProvider providerIsEvenArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsEvenArray')]
public function testIsEvenArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsLogicalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsLogicalTest.php
index ea53a56dc..e00cccb3b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsLogicalTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsLogicalTest.php
@@ -16,9 +16,7 @@ class IsLogicalTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsLogical
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsLogical')]
public function testIsLogical(bool $expectedResult, mixed $value): void
{
$result = Value::isLogical($value);
@@ -30,9 +28,7 @@ class IsLogicalTest extends TestCase
return require 'tests/data/Calculation/Information/IS_LOGICAL.php';
}
- /**
- * @dataProvider providerIsLogicalArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsLogicalArray')]
public function testIsLogicalArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNaTest.php
index 87e6be25b..72b841367 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNaTest.php
@@ -16,9 +16,7 @@ class IsNaTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsNa
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNa')]
public function testIsNa(bool $expectedResult, mixed $value): void
{
$result = ErrorValue::isNa($value);
@@ -30,9 +28,7 @@ class IsNaTest extends TestCase
return require 'tests/data/Calculation/Information/IS_NA.php';
}
- /**
- * @dataProvider providerIsNaArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNaArray')]
public function testIsNaArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNonTextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNonTextTest.php
index e84c835cc..c639c93a5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNonTextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNonTextTest.php
@@ -16,9 +16,7 @@ class IsNonTextTest extends TestCase
self::assertTrue($result);
}
- /**
- * @dataProvider providerIsNonText
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNonText')]
public function testIsNonText(bool $expectedResult, mixed $value): void
{
$result = Value::isNonText($value);
@@ -30,9 +28,7 @@ class IsNonTextTest extends TestCase
return require 'tests/data/Calculation/Information/IS_NONTEXT.php';
}
- /**
- * @dataProvider providerIsNonTextArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNonTextArray')]
public function testIsNonTextArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNumberTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNumberTest.php
index 91850022c..180fbc22d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNumberTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsNumberTest.php
@@ -16,9 +16,7 @@ class IsNumberTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsNumber
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNumber')]
public function testIsNumber(bool $expectedResult, mixed $value): void
{
$result = Value::isNumber($value);
@@ -30,9 +28,7 @@ class IsNumberTest extends TestCase
return require 'tests/data/Calculation/Information/IS_NUMBER.php';
}
- /**
- * @dataProvider providerIsNumberArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsNumberArray')]
public function testIsNumberArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsOddTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsOddTest.php
index fb94d483c..6ff3d6ec3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsOddTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsOddTest.php
@@ -17,9 +17,7 @@ class IsOddTest extends TestCase
self::assertSame(ExcelError::NAME(), $result);
}
- /**
- * @dataProvider providerIsOdd
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsOdd')]
public function testIsOdd(bool|string $expectedResult, mixed $value): void
{
$result = Value::isOdd($value);
@@ -31,9 +29,7 @@ class IsOddTest extends TestCase
return require 'tests/data/Calculation/Information/IS_ODD.php';
}
- /**
- * @dataProvider providerIsOddArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsOddArray')]
public function testIsOddArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsTextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsTextTest.php
index 0fee579c0..f75e2ff17 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsTextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/IsTextTest.php
@@ -16,9 +16,7 @@ class IsTextTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerIsText
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsText')]
public function testIsText(bool $expectedResult, mixed $value): void
{
$result = Value::isText($value);
@@ -30,9 +28,7 @@ class IsTextTest extends TestCase
return require 'tests/data/Calculation/Information/IS_TEXT.php';
}
- /**
- * @dataProvider providerIsTextArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsTextArray')]
public function testIsTextArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/NTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/NTest.php
index 2224ad87a..8c534dba2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/NTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/NTest.php
@@ -15,9 +15,7 @@ class NTest extends TestCase
self::assertSame(0, $result);
}
- /**
- * @dataProvider providerN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerN')]
public function testN(mixed $expectedResult, mixed $value): void
{
$result = Value::asNumber($value);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/TypeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/TypeTest.php
index 4b36ccd6d..63ff4712b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Information/TypeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Information/TypeTest.php
@@ -15,9 +15,7 @@ class TypeTest extends TestCase
self::assertSame(1, $result);
}
- /**
- * @dataProvider providerTYPE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTYPE')]
public function testTYPE(int $expectedResult, mixed $value): void
{
$result = Value::type($value);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php
index 277318cf2..e1eb46aa1 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/AndTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
class AndTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAND')]
public function testAND(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('AND', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class AndTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/AND.php';
}
- /**
- * @dataProvider providerANDLiteral
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerANDLiteral')]
public function testANDLiteral(bool|string $expectedResult, float|int|string $formula): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php
index 6329c9b0e..adb98070d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfErrorTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class IfErrorTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIFERROR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIFERROR')]
public function testIFERROR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('IFERROR', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class IfErrorTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/IFERROR.php';
}
- /**
- * @dataProvider providerIfErrorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIfErrorArray')]
public function testIfErrorArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php
index a629bd7ab..f0fb8fdaa 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfNaTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class IfNaTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIFNA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIFNA')]
public function testIFNA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('IFNA', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class IfNaTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/IFNA.php';
}
- /**
- * @dataProvider providerIfNaArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIfNaArray')]
public function testIfNaArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php
index fc631043a..ebe5f3b54 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
class IfTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIF')]
public function testIF(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('IF', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfsTest.php
index eeb38b9a2..ff52852d8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/IfsTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class IfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIFS')]
public function testIFS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('IFS', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class IfsTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/IFS.php';
}
- /**
- * @dataProvider providerIfsArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIfsArray')]
public function testIfsArray(array $expectedResult, string $bool1, string $argument1, string $bool2, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php
index db53b3894..a4a071643 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/NotTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NotTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNOT')]
public function testNOT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('NOT', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NotTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/NOT.php';
}
- /**
- * @dataProvider providerNotArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNotArray')]
public function testNotArray(array $expectedResult, string $argument1): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php
index c54448e03..1b975aa0d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/OrTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
class OrTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOR')]
public function testOR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('OR', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class OrTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/OR.php';
}
- /**
- * @dataProvider providerORLiteral
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerORLiteral')]
public function testORLiteral(bool|string $expectedResult, float|int|string $formula): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php
index c07daa8b4..b1311f38c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/SwitchTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SwitchTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSwitch
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSwitch')]
public function testSWITCH(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('SWITCH', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class SwitchTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/SWITCH.php';
}
- /**
- * @dataProvider providerSwitchArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSwitchArray')]
public function testIfsArray(array $expectedResult, int $expression, int $value1, string $result1, int $value2, string $result2, string $default): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php
index e319cbb4a..ea4a8bb06 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Logical/XorTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Logical;
class XorTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerXOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerXOR')]
public function testXOR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCase('XOR', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class XorTest extends AllSetupTeardown
return require 'tests/data/Calculation/Logical/XOR.php';
}
- /**
- * @dataProvider providerXORLiteral
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerXORLiteral')]
public function xtestXORLiteral(mixed $expectedResult, string $formula): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressInternationalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressInternationalTest.php
index d7aa9101c..0c9b84e9e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressInternationalTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressInternationalTest.php
@@ -24,9 +24,7 @@ class AddressInternationalTest extends AllSetupTeardown
parent::tearDown();
}
- /**
- * @dataProvider providerInternational
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInternational')]
public function testR1C1International(string $locale, string $r, string $c): void
{
if ($locale !== '') {
@@ -55,9 +53,7 @@ class AddressInternationalTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCompatibility
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCompatibility')]
public function testCompatibilityInternational(string $compatibilityMode, string $r, string $c): void
{
Functions::setCompatibilityMode($compatibilityMode);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php
index 0bb9833ab..0fa5b2f8d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class AddressTest extends TestCase
{
- /**
- * @dataProvider providerADDRESS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerADDRESS')]
public function testADDRESS(mixed $expectedResult, mixed ...$args): void
{
$result = LookupRef\Address::cell(...$args);
@@ -24,9 +22,7 @@ class AddressTest extends TestCase
return require 'tests/data/Calculation/LookupRef/ADDRESS.php';
}
- /**
- * @dataProvider providerAddressArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAddressArray')]
public function testAddressArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php
index 7a495a5ca..815ee8f2d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class ChooseTest extends TestCase
{
- /**
- * @dataProvider providerCHOOSE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHOOSE')]
public function testCHOOSE(mixed $expectedResult, mixed ...$args): void
{
$result = LookupRef\Selection::choose(...$args);
@@ -24,9 +22,7 @@ class ChooseTest extends TestCase
return require 'tests/data/Calculation/LookupRef/CHOOSE.php';
}
- /**
- * @dataProvider providerChooseArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerChooseArray')]
public function testChooseArray(array $expectedResult, string $values, array $selections): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnOnSpreadsheetTest.php
index de7a6cc22..3382a1e38 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnOnSpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnOnSpreadsheetTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\NamedRange;
class ColumnOnSpreadsheetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOLUMNonSpreadsheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOLUMNonSpreadsheet')]
public function testColumnOnSpreadsheet(mixed $expectedResult, string $cellReference = 'omitted'): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnTest.php
index 9b007b0a9..eb16ae6d8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
class ColumnTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOLUMN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOLUMN')]
public function testCOLUMN(mixed $expectedResult, null|array|string $cellReference = null): void
{
$result = LookupRef\RowColumnInformation::COLUMN($cellReference);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsOnSpreadsheetTest.php
index 76c866e5c..f3814d4f9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsOnSpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsOnSpreadsheetTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\NamedRange;
class ColumnsOnSpreadsheetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOLUMNSonSpreadsheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOLUMNSonSpreadsheet')]
public function testColumnsOnSpreadsheet(mixed $expectedResult, string $cellReference = 'omitted'): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php
index 641119a9d..74696967d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class ColumnsTest extends TestCase
{
- /**
- * @dataProvider providerCOLUMNS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOLUMNS')]
public function testCOLUMNS(mixed $expectedResult, null|array|string $arg): void
{
$result = LookupRef\RowColumnInformation::COLUMNS($arg);
@@ -24,9 +22,7 @@ class ColumnsTest extends TestCase
return require 'tests/data/Calculation/LookupRef/COLUMNS.php';
}
- /**
- * @dataProvider providerColumnsArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColumnsArray')]
public function testColumnsArray(int $expectedResult, string $argument): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/FormulaTextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/FormulaTextTest.php
index 23a52cab3..0b13cc8fb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/FormulaTextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/FormulaTextTest.php
@@ -11,9 +11,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\LookupRef\Formula;
*/
class FormulaTextTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFormulaText
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormulaText')]
public function testFormulaText(string $expectedResult, mixed $value): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php
index 682a12e02..679cbe28b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php
@@ -12,9 +12,7 @@ use PHPUnit\Framework\TestCase;
class HLookupTest extends TestCase
{
- /**
- * @dataProvider providerHLOOKUP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHLOOKUP')]
public function testHLOOKUP(mixed $expectedResult, mixed $lookup, array $values, mixed $rowIndex, ?bool $rangeLookup = null): void
{
$spreadsheet = new Spreadsheet();
@@ -72,9 +70,7 @@ class HLookupTest extends TestCase
return require 'tests/data/Calculation/LookupRef/HLOOKUP.php';
}
- /**
- * @dataProvider providerHLookupNamedRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHLookupNamedRange')]
public function testHLookupNamedRange(string $expectedResult, string $cellAddress): void
{
$lookupData = [
@@ -110,9 +106,7 @@ class HLookupTest extends TestCase
];
}
- /**
- * @dataProvider providerHLookupArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHLookupArray')]
public function testHLookupArray(array $expectedResult, string $values, string $database, string $index): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HyperlinkTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HyperlinkTest.php
index 5e8420e14..7e8f7d157 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HyperlinkTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HyperlinkTest.php
@@ -11,9 +11,7 @@ class HyperlinkTest extends AllSetupTeardown
{
private bool $issue2464 = true;
- /**
- * @dataProvider providerHYPERLINK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHYPERLINK')]
public function testHYPERLINK(mixed $expectedResult, ?string $linkUrl, ?string $description): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +37,7 @@ class HyperlinkTest extends AllSetupTeardown
}
}
- /**
- * @dataProvider providerHYPERLINK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHYPERLINK')]
public function testHYPERLINKcellRef(mixed $expectedResult, ?string $linkUrl, ?string $description): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php
index 3f508405a..08cf905c5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexOnSpreadsheetTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
class IndexOnSpreadsheetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerINDEXonSpreadsheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINDEXonSpreadsheet')]
public function testIndexOnSpreadsheet(mixed $expectedResult, array $matrix, null|int|string $rowNum = null, null|int|string $colNum = null): void
{
$this->mightHaveException($expectedResult);
@@ -35,9 +33,7 @@ class IndexOnSpreadsheetTest extends AllSetupTeardown
return require 'tests/data/Calculation/LookupRef/INDEXonSpreadsheet.php';
}
- /**
- * @dataProvider providerIndexLiteralArrays
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIndexLiteralArrays')]
public function testLiteralArrays(mixed $expectedResult, string $indexArgs): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php
index 9b3f5de2e..930bfd8a9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class IndexTest extends TestCase
{
- /**
- * @dataProvider providerINDEX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINDEX')]
public function testINDEX(mixed $expectedResult, mixed $matrix, mixed $rowNum = null, mixed $colNum = null): void
{
if ($rowNum === null) {
@@ -31,9 +29,7 @@ class IndexTest extends TestCase
return require 'tests/data/Calculation/LookupRef/INDEX.php';
}
- /**
- * @dataProvider providerIndexArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIndexArray')]
public function testIndexArray(array $expectedResult, string $matrix, string $rows, string $columns): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectInternationalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectInternationalTest.php
index e0624ed8d..556b7c653 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectInternationalTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectInternationalTest.php
@@ -24,9 +24,7 @@ class IndirectInternationalTest extends AllSetupTeardown
parent::tearDown();
}
- /**
- * @dataProvider providerInternational
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInternational')]
public function testR1C1International(string $locale): void
{
Settings::setLocale($locale);
@@ -79,9 +77,7 @@ class IndirectInternationalTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerRelativeInternational
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRelativeInternational')]
public function testRelativeInternational(string $locale, string $cell, string $relative): void
{
Settings::setLocale($locale);
@@ -101,9 +97,7 @@ class IndirectInternationalTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCompatibility
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCompatibility')]
public function testCompatibilityInternational(string $compatibilityMode): void
{
Functions::setCompatibilityMode($compatibilityMode);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php
index 4b29a787c..2ffa01381 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php
@@ -10,9 +10,7 @@ use PhpOffice\PhpSpreadsheet\Reader\Xlsx as ReaderXlsx;
class IndirectTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerINDIRECT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINDIRECT')]
public function testINDIRECT(mixed $expectedResult, mixed $cellReference = 'omitted', mixed $a1 = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -132,9 +130,7 @@ class IndirectTest extends AllSetupTeardown
self::assertSame('This is it', $result);
}
- /**
- * @dataProvider providerRelative
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRelative')]
public function testR1C1Relative(string|int|null $expectedResult, string $address): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php
index 7194fe380..6e6c67437 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class LookupTest extends TestCase
{
- /**
- * @dataProvider providerLOOKUP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOOKUP')]
public function testLOOKUP(mixed $expectedResult, mixed ...$args): void
{
$result = LookupRef\Lookup::lookup(...$args);
@@ -25,9 +23,7 @@ class LookupTest extends TestCase
return require 'tests/data/Calculation/LookupRef/LOOKUP.php';
}
- /**
- * @dataProvider providerLookupArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLookupArray')]
public function testLookupArray(array $expectedResult, string $values, string $lookup, string $return): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php
index 211680f7d..2acbccf40 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatchTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class MatchTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMATCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMATCH')]
public function testMATCH(mixed $expectedResult, mixed $input, array $array, null|float|int|string $type = null): void
{
if (is_array($expectedResult)) {
@@ -39,9 +37,7 @@ class MatchTest extends AllSetupTeardown
self::assertEquals($expectedResult, $result);
}
- /**
- * @dataProvider providerMATCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMATCH')]
public function testMATCHLibre(mixed $expectedResult, mixed $input, array $array, null|float|int|string $type = null): void
{
$this->setOpenOffice();
@@ -76,9 +72,7 @@ class MatchTest extends AllSetupTeardown
return require 'tests/data/Calculation/LookupRef/MATCH.php';
}
- /**
- * @dataProvider providerMatchArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMatchArray')]
public function testMatchArray(array $expectedResult, string $values, string $selections): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatrixHelperFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatrixHelperFunctionsTest.php
index 62e3b0357..eeb2cec49 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatrixHelperFunctionsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/MatrixHelperFunctionsTest.php
@@ -9,18 +9,14 @@ use PHPUnit\Framework\TestCase;
class MatrixHelperFunctionsTest extends TestCase
{
- /**
- * @dataProvider columnVectorProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('columnVectorProvider')]
public function testIsColumnVector(bool $expectedResult, array $array): void
{
$result = Matrix::isColumnVector($array);
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider rowVectorProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rowVectorProvider')]
public function testIsRowVector(bool $expectedResult, array $array): void
{
$result = Matrix::isRowVector($array);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/OffsetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/OffsetTest.php
index 2bf7f67bc..c6a66c4c2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/OffsetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/OffsetTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\NamedRange;
class OffsetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerOFFSET
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOFFSET')]
public function testOFFSET(mixed $expectedResult, null|string $cellReference = null): void
{
$result = LookupRef\Offset::OFFSET($cellReference);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowOnSpreadsheetTest.php
index 53fdbf087..ca22fdcc8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowOnSpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowOnSpreadsheetTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\NamedRange;
class RowOnSpreadsheetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerROWonSpreadsheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerROWonSpreadsheet')]
public function testRowOnSpreadsheet(mixed $expectedResult, string $cellReference = 'omitted'): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowTest.php
index fbc4c12d6..9d8d8c393 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
class RowTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerROW
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerROW')]
public function testROW(mixed $expectedResult, null|array|string $cellReference = null): void
{
$result = LookupRef\RowColumnInformation::ROW($cellReference);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsOnSpreadsheetTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsOnSpreadsheetTest.php
index 5d21d9fc7..aeb589c4d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsOnSpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsOnSpreadsheetTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\NamedRange;
class RowsOnSpreadsheetTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerROWSonSpreadsheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerROWSonSpreadsheet')]
public function testRowsOnSpreadsheet(mixed $expectedResult, string $cellReference = 'omitted'): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php
index 11781aabc..312304f60 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class RowsTest extends TestCase
{
- /**
- * @dataProvider providerROWS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerROWS')]
public function testROWS(mixed $expectedResult, null|array|string $arg): void
{
$result = LookupRef\RowColumnInformation::ROWS($arg);
@@ -24,9 +22,7 @@ class RowsTest extends TestCase
return require 'tests/data/Calculation/LookupRef/ROWS.php';
}
- /**
- * @dataProvider providerRowsArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRowsArray')]
public function testRowsArray(int $expectedResult, string $argument): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortByTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortByTest.php
index 99e0a6e45..7d2ba3ec7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortByTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortByTest.php
@@ -18,9 +18,7 @@ class SortByTest extends TestCase
self::assertSame($value, $result);
}
- /**
- * @dataProvider providerSortWithScalarArgumentErrorReturns
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortWithScalarArgumentErrorReturns')]
public function testSortByWithArgumentErrorReturns(mixed $sortIndex, mixed $sortOrder = 1): void
{
$value = [[1, 2], [3, 4], [5, 6]];
@@ -41,9 +39,7 @@ class SortByTest extends TestCase
];
}
- /**
- * @dataProvider providerSortByRow
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortByRow')]
public function testSortByRow(array $expectedResult, array $matrix, mixed ...$args): void
{
$result = Sort::sortBy($matrix, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortTest.php
index 8334c20bf..2670caa16 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/SortTest.php
@@ -18,9 +18,7 @@ class SortTest extends TestCase
self::assertSame($value, $result);
}
- /**
- * @dataProvider providerSortWithScalarArgumentErrorReturns
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortWithScalarArgumentErrorReturns')]
public function testSortWithScalarArgumentErrorReturns(mixed $sortIndex, mixed $sortOrder = 1): void
{
$value = [[1, 2], [3, 4], [5, 6]];
@@ -48,9 +46,7 @@ class SortTest extends TestCase
];
}
- /**
- * @dataProvider providerSortByRow
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortByRow')]
public function testSortByRow(array $expectedResult, array $matrix, int $sortIndex, int $sortOrder = Sort::ORDER_ASCENDING): void
{
$result = Sort::sort($matrix, $sortIndex, $sortOrder);
@@ -79,9 +75,7 @@ class SortTest extends TestCase
];
}
- /**
- * @dataProvider providerSortByRowMultiLevel
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortByRowMultiLevel')]
public function testSortByRowMultiLevel(array $expectedResult, array $matrix, array $sortIndex, int $sortOrder = Sort::ORDER_ASCENDING): void
{
$result = Sort::sort($matrix, $sortIndex, $sortOrder);
@@ -148,9 +142,7 @@ class SortTest extends TestCase
];
}
- /**
- * @dataProvider providerSortByColumn
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSortByColumn')]
public function testSortByColumn(array $expectedResult, array $matrix, int $sortIndex, int $sortOrder): void
{
$result = Sort::sort($matrix, $sortIndex, $sortOrder, true);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/TransposeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/TransposeTest.php
index 189269569..67d0c2bde 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/TransposeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/TransposeTest.php
@@ -15,9 +15,7 @@ class TransposeTest extends TestCase
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
}
- /**
- * @dataProvider providerTRANSPOSE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTRANSPOSE')]
public function testTRANSPOSE(mixed $expectedResult, mixed $matrix): void
{
$result = LookupRef\Matrix::transpose($matrix);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/UniqueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/UniqueTest.php
index c7996ea2a..3a38248be 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/UniqueTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/UniqueTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class UniqueTest extends TestCase
{
- /**
- * @dataProvider uniqueTestProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('uniqueTestProvider')]
public function testUnique(array $expectedResult, array $lookupRef, bool $byColumn = false, bool $exactlyOnce = false): void
{
$result = LookupRef\Unique::unique($lookupRef, $byColumn, $exactlyOnce);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php
index ad320dfd0..169f203a0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class VLookupTest extends TestCase
{
- /**
- * @dataProvider providerVLOOKUP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVLOOKUP')]
public function testVLOOKUP(mixed $expectedResult, mixed $value, mixed $table, mixed $index, ?bool $lookup = null): void
{
$spreadsheet = new Spreadsheet();
@@ -50,9 +48,7 @@ class VLookupTest extends TestCase
return require 'tests/data/Calculation/LookupRef/VLOOKUP.php';
}
- /**
- * @dataProvider providerVLookupArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVLookupArray')]
public function testVLookupArray(array $expectedResult, string $values, string $database, string $index): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php
index e16a05d77..e3561996f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AbsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAbs
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAbs')]
public function testAbs(mixed $expectedResult, mixed $number = 'omitted'): void
{
$sheet = $this->getSheet();
@@ -30,9 +28,7 @@ class AbsTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ABS.php';
}
- /**
- * @dataProvider providerAbsArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAbsArray')]
public function testAbsoluteArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php
index 8ba2e2a3a..c4214f587 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcosTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AcosTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAcos
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcos')]
public function testAcos(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AcosTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ACOS.php';
}
- /**
- * @dataProvider providerAcosArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcosArray')]
public function testAcosArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php
index 98ca3353c..9a31fa8d1 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcoshTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AcoshTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAcosh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcosh')]
public function testAcosh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AcoshTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ACOSH.php';
}
- /**
- * @dataProvider providerAcoshArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcoshArray')]
public function testAcoshArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php
index 8e508aa15..3b85fff8f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcotTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AcotTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerACOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerACOT')]
public function testACOT(float|int|string $expectedResult, float|int|string $number): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class AcotTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ACOT.php';
}
- /**
- * @dataProvider providerAcotArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcotArray')]
public function testAcotArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php
index 85ccdf44a..1475d77d2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AcothTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AcothTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerACOTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerACOTH')]
public function testACOTH(float|int|string $expectedResult, float|int|string $number): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class AcothTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ACOTH.php';
}
- /**
- * @dataProvider providerAcothArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAcothArray')]
public function testAcothArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php
index d5fd394a7..60e108272 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ArabicTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ArabicTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerARABIC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerARABIC')]
public function testARABIC(mixed $expectedResult, string $romanNumeral): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class ArabicTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ARABIC.php';
}
- /**
- * @dataProvider providerArabicArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerArabicArray')]
public function testArabicArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php
index 6024504c4..cbf991494 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AsinTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAsin
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsin')]
public function testAsin(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AsinTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ASIN.php';
}
- /**
- * @dataProvider providerAsinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsinArray')]
public function testAsinArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php
index 019ffb550..2795b36a8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AsinhTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AsinhTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAsinh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsinh')]
public function testAsinh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AsinhTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ASINH.php';
}
- /**
- * @dataProvider providerAsinhArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsinhArray')]
public function testAsinhArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php
index be37fdd24..bbfa4da2d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Atan2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class Atan2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerATAN2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerATAN2')]
public function testATAN2(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -27,9 +25,7 @@ class Atan2Test extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ATAN2.php';
}
- /**
- * @dataProvider providerAtan2Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAtan2Array')]
public function testAtan2Array(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php
index d4156d6c2..7c217f81b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AtanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAtan
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAtan')]
public function testAtan(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AtanTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ATAN.php';
}
- /**
- * @dataProvider providerAtanArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAtanArray')]
public function testAtanArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php
index 0433535e3..3a121aa94 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AtanhTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class AtanhTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAtanh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAtanh')]
public function testAtanh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class AtanhTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ATANH.php';
}
- /**
- * @dataProvider providerAtanhArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAtanhArray')]
public function testAtanhArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php
index 77b661c66..a1c5e4e0b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/BaseTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BaseTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBASE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBASE')]
public function testBASE(mixed $expectedResult, mixed $arg1 = 'omitted', mixed $arg2 = 'omitted', mixed $arg3 = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -42,9 +40,7 @@ class BaseTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/BASE.php';
}
- /**
- * @dataProvider providerBaseArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBaseArray')]
public function testBaseArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php
index 384600d5b..78d947e17 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingMathTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CeilingMathTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCEILINGMATH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCEILINGMATH')]
public function testCEILINGMATH(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CeilingMathTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/CEILINGMATH.php';
}
- /**
- * @dataProvider providerCeilingArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCeilingArray')]
public function testCeilingArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php
index d6e60e529..922500c81 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingPreciseTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CeilingPreciseTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFLOORPRECISE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFLOORPRECISE')]
public function testCEILINGPRECISE(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CeilingPreciseTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/CEILINGPRECISE.php';
}
- /**
- * @dataProvider providerCeilingArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCeilingArray')]
public function testCeilingArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php
index ba246a03e..72cac5582 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CeilingTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CeilingTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCEILING
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCEILING')]
public function testCEILING(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -56,9 +54,7 @@ class CeilingTest extends AllSetupTeardown
self::assertEqualsWithDelta(6, $result, 1E-12);
}
- /**
- * @dataProvider providerCeilingArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCeilingArray')]
public function testCeilingArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php
index bc3d41ba8..0dced2da8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinATest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CombinATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOMBINA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMBINA')]
public function testCOMBINA(mixed $expectedResult, mixed $numObjs, mixed $numInSet): void
{
$this->mightHaveException($expectedResult);
@@ -31,9 +29,7 @@ class CombinATest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COMBINA.php';
}
- /**
- * @dataProvider providerCombinAArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCombinAArray')]
public function testCombinAArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php
index 6c4cdfa26..ffe44293a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CombinTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CombinTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOMBIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOMBIN')]
public function testCOMBIN(mixed $expectedResult, mixed $numObjs, mixed $numInSet): void
{
$this->mightHaveException($expectedResult);
@@ -31,9 +29,7 @@ class CombinTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COMBIN.php';
}
- /**
- * @dataProvider providerCombinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCombinArray')]
public function testCombinArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php
index 0f5513d2d..538e2a964 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CosTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CosTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCos
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCos')]
public function testCos(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class CosTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COS.php';
}
- /**
- * @dataProvider providerCosArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCosArray')]
public function testCosArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php
index 0239c1ee6..40611d754 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CoshTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CoshTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCosh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCosh')]
public function testCosh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class CoshTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COSH.php';
}
- /**
- * @dataProvider providerCoshArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCoshArray')]
public function testCoshArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php
index d47520334..c62a76bef 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CotTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CotTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOT')]
public function testCOT(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CotTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COT.php';
}
- /**
- * @dataProvider providerCotArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCotArray')]
public function testCotArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php
index d41b09370..445d97b44 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CothTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CothTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOTH')]
public function testCOTH(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CothTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/COTH.php';
}
- /**
- * @dataProvider providerCothArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCothArray')]
public function testCothArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php
index 5cf58296e..9e835b503 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CscTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CscTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCSC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCSC')]
public function testCSC(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CscTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/CSC.php';
}
- /**
- * @dataProvider providerCscArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCscArray')]
public function testCscArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php
index 5865c4c82..77237729e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/CschTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CschTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCSCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCSCH')]
public function testCSCH(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class CschTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/CSCH.php';
}
- /**
- * @dataProvider providerCschArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCschArray')]
public function testCschArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php
index 14d3d72bd..b6f546266 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/DegreesTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class DegreesTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDEGREES
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEGREES')]
public function testDegrees(mixed $expectedResult, mixed $number = 'omitted'): void
{
$sheet = $this->getSheet();
@@ -30,9 +28,7 @@ class DegreesTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/DEGREES.php';
}
- /**
- * @dataProvider providerDegreesArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDegreesArray')]
public function testDegreesArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php
index 4f56e921a..653e4d083 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/EvenTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class EvenTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerEVEN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEVEN')]
public function testEVEN(int|string $expectedResult, float|int|string $value): void
{
$this->mightHaveException($expectedResult);
@@ -25,9 +23,7 @@ class EvenTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/EVEN.php';
}
- /**
- * @dataProvider providerEvenArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEvenArray')]
public function testEvenArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php
index 7af6b3b09..188acd934 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ExpTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ExpTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerEXP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEXP')]
public function testEXP(mixed $expectedResult, mixed $number = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -32,9 +30,7 @@ class ExpTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/EXP.php';
}
- /**
- * @dataProvider providerExpArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExpArray')]
public function testExpArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php
index e405c5d0f..15f8159a2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactDoubleTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FactDoubleTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFACTDOUBLE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFACTDOUBLE')]
public function testFACTDOUBLE(mixed $expectedResult, mixed $value): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class FactDoubleTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/FACTDOUBLE.php';
}
- /**
- * @dataProvider providerFactDoubleArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFactDoubleArray')]
public function testFactDoubleArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php
index 1b1dbdb5c..3ff4da971 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php
@@ -10,9 +10,7 @@ class FactTest extends AllSetupTeardown
{
const FACT_PRECISION = 1E-12;
- /**
- * @dataProvider providerFACT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFACT')]
public function testFACT(mixed $expectedResult, mixed $arg1): void
{
$this->mightHaveException($expectedResult);
@@ -34,9 +32,7 @@ class FactTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/FACT.php';
}
- /**
- * @dataProvider providerFACTGnumeric
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFACTGnumeric')]
public function testFACTGnumeric(mixed $expectedResult, mixed $arg1): void
{
$this->mightHaveException($expectedResult);
@@ -59,9 +55,7 @@ class FactTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/FACTGNUMERIC.php';
}
- /**
- * @dataProvider providerFactArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFactArray')]
public function testFactArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php
index f91076a23..5f528cc86 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorMathTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FloorMathTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFLOORMATH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFLOORMATH')]
public function testFLOORMATH(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class FloorMathTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/FLOORMATH.php';
}
- /**
- * @dataProvider providerFloorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFloorArray')]
public function testFloorArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php
index 3a43822e9..74d3ce406 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorPreciseTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FloorPreciseTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFLOORPRECISE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFLOORPRECISE')]
public function testFLOORPRECISE(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class FloorPreciseTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/FLOORPRECISE.php';
}
- /**
- * @dataProvider providerFloorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFloorArray')]
public function testFloorArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php
index 3d56fb328..df19f229e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FloorTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FloorTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFLOOR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFLOOR')]
public function testFLOOR(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -56,9 +54,7 @@ class FloorTest extends AllSetupTeardown
self::assertEqualsWithDelta(5, $result, 1E-12);
}
- /**
- * @dataProvider providerFloorArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFloorArray')]
public function testFloorArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php
index e7684ba14..20103cbfd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/GcdTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class GcdTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGCD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGCD')]
public function testGCD(mixed $expectedResult, mixed ...$args): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php
index 7f551e343..0e81fcafb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/IntTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class IntTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerINT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINT')]
public function testINT(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class IntTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/INT.php';
}
- /**
- * @dataProvider providerIntArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIntArray')]
public function testIntArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php
index 13d3b9940..d27358f5c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LcmTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class LcmTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLCM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLCM')]
public function testLCM(mixed $expectedResult, mixed ...$args): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php
index ca7eb78e8..774e2bc83 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LnTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LnTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLN')]
public function testLN(mixed $expectedResult, mixed $number = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -32,9 +30,7 @@ class LnTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/LN.php';
}
- /**
- * @dataProvider providerLnArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLnArray')]
public function testLnArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php
index 63ff4e952..52635d426 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/Log10Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class Log10Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOG10
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOG10')]
public function testLOG10(mixed $expectedResult, mixed $number = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -32,9 +30,7 @@ class Log10Test extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/LOG10.php';
}
- /**
- * @dataProvider providerLog10Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLog10Array')]
public function testLog10Array(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php
index 69cd275be..62afdd287 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/LogTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LogTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOG
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOG')]
public function testLOG(mixed $expectedResult, mixed $number = 'omitted', mixed $base = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -37,9 +35,7 @@ class LogTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/LOG.php';
}
- /**
- * @dataProvider providerLogArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLogArray')]
public function testLogArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php
index 63c118572..cc98cab1a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MInverseTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
class MInverseTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMINVERSE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINVERSE')]
public function testMINVERSE(mixed $expectedResult, array $args): void
{
$result = MathTrig\MatrixFunctions::inverse($args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php
index 86ee26fd9..8925151f7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MMultTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
class MMultTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMMULT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMMULT')]
public function testMMULT(mixed $expectedResult, mixed ...$args): void
{
$result = MathTrig\MatrixFunctions::multiply(...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php
index eab6e20ae..32020c71f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MRoundTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class MRoundTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMROUND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMROUND')]
public function testMROUND(float|int|string $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class MRoundTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/MROUND.php';
}
- /**
- * @dataProvider providerMRoundArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMRoundArray')]
public function testMRoundArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php
index cd9b090a9..f171cf6f8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MdeTermTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class MdeTermTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMDETERM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMDETERM')]
public function testMDETERM2(float|int|string $expectedResult, array|int|float|string $matrix): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php
index f33b88650..bbedd1f3d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ModTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ModTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMOD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMOD')]
public function testMOD(mixed $expectedResult, mixed $dividend = 'omitted', mixed $divisor = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -37,9 +35,7 @@ class ModTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/MOD.php';
}
- /**
- * @dataProvider providerModArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerModArray')]
public function testModArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php
index ce189b44e..695d63c79 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/MultinomialTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class MultinomialTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMULTINOMIAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMULTINOMIAL')]
public function testMULTINOMIAL(mixed $expectedResult, mixed ...$args): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php
index d73235a7c..a61259643 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/OddTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class OddTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerODD
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerODD')]
public function testODD(int|string $expectedResult, float|int|string $value): void
{
$this->mightHaveException($expectedResult);
@@ -25,9 +23,7 @@ class OddTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ODD.php';
}
- /**
- * @dataProvider providerOddArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOddArray')]
public function testOddArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PiTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PiTest.php
index 130f02f98..71337d1b5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PiTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PiTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class PiTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPI')]
public function testPI(mixed $expectedResult, mixed $number = 'omitted'): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php
index 0bf42f09a..abf9f7ef3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/PowerTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class PowerTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPOWER')]
public function testPOWER(mixed $expectedResult, mixed $base = 'omitted', mixed $exponent = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -37,9 +35,7 @@ class PowerTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/POWER.php';
}
- /**
- * @dataProvider providerPowerArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPowerArray')]
public function testPowerArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php
index 7b4bc296e..34bbf0db9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/ProductTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class ProductTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPRODUCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPRODUCT')]
public function testPRODUCT(mixed $expectedResult, mixed ...$args): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php
index 84c2856be..eb5827d5b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/QuotientTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class QuotientTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerQUOTIENT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerQUOTIENT')]
public function testQUOTIENT(mixed $expectedResult, mixed $arg1 = 'omitted', mixed $arg2 = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -37,9 +35,7 @@ class QuotientTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/QUOTIENT.php';
}
- /**
- * @dataProvider providerQuotientArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerQuotientArray')]
public function testQuotientArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php
index fb3c784eb..63dfb7fd0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RadiansTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RadiansTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRADIANS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRADIANS')]
public function testRADIANS(mixed $expectedResult, mixed $number = 'omitted'): void
{
$sheet = $this->getSheet();
@@ -30,9 +28,7 @@ class RadiansTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/RADIANS.php';
}
- /**
- * @dataProvider providerRadiansArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRadiansArray')]
public function testRadiansArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php
index 6086685f9..9b64991b5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RandBetweenTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RandBetweenTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRANDBETWEEN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRANDBETWEEN')]
public function testRANDBETWEEN(int|string $expectedResult, null|bool|int|string $min = 'omitted', null|bool|int|string $max = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -44,9 +42,7 @@ class RandBetweenTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/RANDBETWEEN.php';
}
- /**
- * @dataProvider providerRandBetweenArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRandBetweenArray')]
public function testRandBetweenArray(
int $expectedRows,
int $expectedColumns,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php
index de8be1b07..57096ac27 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RomanTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RomanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerROMAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerROMAN')]
public function testROMAN(string $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class RomanTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ROMAN.php';
}
- /**
- * @dataProvider providerRomanArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRomanArray')]
public function testRomanArray(array $expectedResult, string $values, string $styles): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php
index 2f5945d3f..7c440df13 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundDownTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RoundDownTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRoundDown
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRoundDown')]
public function testRoundDown(float|int|string $expectedResult, float|int|string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class RoundDownTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ROUNDDOWN.php';
}
- /**
- * @dataProvider providerRoundDownArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRoundDownArray')]
public function testRoundDownArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php
index 91dcc8610..c10c982d1 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RoundTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRound
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRound')]
public function testRound(float|int|string $expectedResult, float|int|string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class RoundTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ROUND.php';
}
- /**
- * @dataProvider providerRoundArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRoundArray')]
public function testRoundArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php
index 79a32ed68..d7629357b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/RoundUpTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class RoundUpTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRoundUp
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRoundUp')]
public function testRoundUp(float|int|string $expectedResult, float|int|string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class RoundUpTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/ROUNDUP.php';
}
- /**
- * @dataProvider providerRoundUpArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRoundUpArray')]
public function testRoundUpArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php
index 3c391b687..e05c99b8e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SecTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SecTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSEC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSEC')]
public function testSEC(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class SecTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SEC.php';
}
- /**
- * @dataProvider providerSecArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSecArray')]
public function testSecArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php
index 632685070..d2e4df742 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SechTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SechTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSECH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSECH')]
public function testSECH(float|int|string $expectedResult, float|int|string $angle): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class SechTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SECH.php';
}
- /**
- * @dataProvider providerSechArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSechArray')]
public function testSechArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SequenceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SequenceTest.php
index c3b1196c0..c52f99873 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SequenceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SequenceTest.php
@@ -9,11 +9,10 @@ use PhpOffice\PhpSpreadsheet\Calculation\MathTrig\MatrixFunctions;
class SequenceTest extends AllSetupTeardown
{
/**
- * @dataProvider providerSEQUENCE
- *
* @param mixed[] $arguments
* @param mixed[]|string $expectedResult
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSEQUENCE')]
public function testSEQUENCE(array $arguments, array|string $expectedResult): void
{
if (count($arguments) === 0) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php
index 8608f91c8..5f3469f18 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SeriesSumTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class SeriesSumTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSERIESSUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSERIESSUM')]
public function testSERIESSUM(mixed $expectedResult, mixed $arg1, mixed $arg2, mixed $arg3, mixed ...$args): void
{
$sheet = $this->getSheet();
@@ -42,9 +40,7 @@ class SeriesSumTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SERIESSUM.php';
}
- /**
- * @dataProvider providerSeriesSumArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSeriesSumArray')]
public function testSeriesSumArray(array $expectedResult, string $x, string $n, string $m, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php
index a767de73d..2a77d6eb3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SignTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SignTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSIGN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSIGN')]
public function testSIGN(float|int|string $expectedResult, float|int|string $value): void
{
$this->mightHaveException($expectedResult);
@@ -28,9 +26,7 @@ class SignTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SIGN.php';
}
- /**
- * @dataProvider providerSignArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSignArray')]
public function testSignArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php
index 83bc295f8..ea7881361 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SinTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSin
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSin')]
public function testSin(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class SinTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SIN.php';
}
- /**
- * @dataProvider providerSinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSinArray')]
public function testSinArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php
index 0ad727757..50b7b32c4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SinhTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SinhTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCosh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCosh')]
public function testSinh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class SinhTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SINH.php';
}
- /**
- * @dataProvider providerSinhArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSinhArray')]
public function testSinhArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php
index e6a1e783d..1aecc8b6e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtPiTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SqrtPiTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSQRTPI
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSQRTPI')]
public function testSQRTPI(mixed $expectedResult, mixed $number): void
{
$this->mightHaveException($expectedResult);
@@ -32,9 +30,7 @@ class SqrtPiTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SQRTPI.php';
}
- /**
- * @dataProvider providerSqrtPiArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSqrtPiArray')]
public function testSqrtPiArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php
index 4bd348ffc..4e4fea06c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SqrtTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SqrtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSQRT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSQRT')]
public function testSQRT(mixed $expectedResult, mixed $number = 'omitted'): void
{
$sheet = $this->getSheet();
@@ -30,9 +28,7 @@ class SqrtTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SQRT.php';
}
- /**
- * @dataProvider providerSqrtArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSqrtArray')]
public function testSqrtArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php
index cc694aa49..6a2e5c59a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SubTotalTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class SubTotalTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUBTOTAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUBTOTAL')]
public function testSubtotal(float|int|string $expectedResult, float|int|string $type): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class SubTotalTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SUBTOTAL.php';
}
- /**
- * @dataProvider providerSUBTOTAL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUBTOTAL')]
public function testSubtotalColumnHidden(float|int|string $expectedResult, float|int|string $type): void
{
// Hidden columns don't affect calculation, only hidden rows
@@ -60,9 +56,7 @@ class SubTotalTest extends AllSetupTeardown
self::assertEqualsWithDelta($expectedResult, $result, 1E-12);
}
- /**
- * @dataProvider providerSUBTOTALHIDDEN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUBTOTALHIDDEN')]
public function testSubtotalRowHidden(mixed $expectedResult, int $type): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php
index 1f61aa863..9199ada28 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class SumIfTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMIF')]
public function testSUMIF2(mixed $expectedResult, array $array1, mixed $condition, ?array $array2 = null): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php
index eca29781f..fbf6032ef 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumIfsTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Statistical;
class SumIfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMIFS')]
public function testSUMIFS(mixed $expectedResult, mixed ...$args): void
{
$result = Statistical\Conditional::SUMIFS(...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php
index 2158894b9..ddb4ddafc 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumProductTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class SumProductTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMPRODUCT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMPRODUCT')]
public function testSUMPRODUCT(mixed $expectedResult, mixed ...$args): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php
index 41b3e4c61..7af25a1b8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumSqTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\MathTrig;
class SumSqTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMSQ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMSQ')]
public function testSUMSQ(mixed $expectedResult, mixed ...$args): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php
index 5c9bd238d..dfa27f35f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
class SumTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUM')]
public function testSUM(mixed $expectedResult, mixed ...$args): void
{
$sheet = $this->getSheet();
@@ -29,9 +27,7 @@ class SumTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SUM.php';
}
- /**
- * @dataProvider providerSUMLiterals
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMLiterals')]
public function testSUMLiterals(mixed $expectedResult, string $args): void
{
$sheet = $this->getSheet();
@@ -45,9 +41,7 @@ class SumTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/SUMLITERALS.php';
}
- /**
- * @dataProvider providerSUMWITHINDEXMATCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMWITHINDEXMATCH')]
public function testSumWithIndexMatch(mixed $expectedResult, string $formula): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php
index c7d1bf8c2..9e36ac572 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2MY2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class SumX2MY2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMX2MY2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMX2MY2')]
public function testSUMX2MY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php
index b75ea02df..46bc3e17c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumX2PY2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class SumX2PY2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMX2PY2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMX2PY2')]
public function testSUMX2PY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php
index 4cce0ada0..d4f91a8cd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/SumXMY2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Functions;
class SumXMY2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUMXMY2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUMXMY2')]
public function testSUMXMY2(mixed $expectedResult, array $matrixData1, array $matrixData2): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php
index c21d451a1..b58562c1c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTan
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTan')]
public function testTan(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class TanTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/TAN.php';
}
- /**
- * @dataProvider providerTanArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTanArray')]
public function testTanArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php
index 8de5d6803..31f704b22 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TanhTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TanhTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTanh
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTanh')]
public function testTanh(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -26,9 +24,7 @@ class TanhTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/TANH.php';
}
- /**
- * @dataProvider providerTanhArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTanhArray')]
public function testTanhArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php
index 9e610f234..0f6bd0b97 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/TruncTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TruncTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTRUNC
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTRUNC')]
public function testTRUNC(mixed $expectedResult, string $formula): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class TruncTest extends AllSetupTeardown
return require 'tests/data/Calculation/MathTrig/TRUNC.php';
}
- /**
- * @dataProvider providerTruncArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTruncArray')]
public function testTruncArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
@@ -48,9 +44,7 @@ class TruncTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerTooMuchPrecision
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTooMuchPrecision')]
public function testTooMuchPrecision(mixed $expectedResult, float|int|string $value, int $digits = 1): void
{
// This test is pretty screwy. Possibly shouldn't even attempt it.
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php
index ea9c61ef8..7b58094a7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AveDevTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class AveDevTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAVEDEV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAVEDEV')]
public function testAVEDEV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('AVEDEV', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php
index 48788ab40..d8a7542c3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class AverageATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAVERAGEA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAVERAGEA')]
public function testAVERAGEA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('AVERAGEA', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php
index 2b23a77d2..62db48efa 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcException;
class AverageIfTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAVERAGEIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAVERAGEIF')]
public function testAVERAGEIF(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('AVERAGEIF', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfsTest.php
index e3f835809..9aecc553e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageIfsTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcException;
class AverageIfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAVERAGEIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAVERAGEIFS')]
public function testAVERAGEIFS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('AVERAGEIFS', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php
index 078a8313b..21e24c149 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/AverageTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class AverageTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerAVERAGE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAVERAGE')]
public function testAVERAGE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('AVERAGE', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php
index 2a25cbfe6..a50693c00 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BetaDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBETADIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBETADIST')]
public function testBETADIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('BETADIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class BetaDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BETADIST.php';
}
- /**
- * @dataProvider providerBetaDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBetaDistArray')]
public function testBetaDistArray(array $expectedResult, string $argument1, string $argument2, string $argument3): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php
index eab0cf4ba..7550510d1 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BetaInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BetaInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBETAINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBETAINV')]
public function testBETAINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('BETAINV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class BetaInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BETAINV.php';
}
- /**
- * @dataProvider providerBetaInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBetaInvArray')]
public function testBetaInvArray(array $expectedResult, string $argument1, string $argument2, string $argument3): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistRangeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistRangeTest.php
index 9a8ac452f..6ac55ec89 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistRangeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistRangeTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BinomDistRangeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBINOMDISTRANGE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBINOMDISTRANGE')]
public function testBINOMDISTRANGE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('BINOM.DIST.RANGE', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class BinomDistRangeTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BINOMDISTRANGE.php';
}
- /**
- * @dataProvider providerBinomDistRangeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinomDistRangeArray')]
public function testBinomDistRangeArray(
array $expectedResult,
string $trials,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php
index 5f824d717..94b1b71a5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BinomDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBINOMDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBINOMDIST')]
public function testBINOMDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('BINOMDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class BinomDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BINOMDIST.php';
}
- /**
- * @dataProvider providerBinomDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinomDistArray')]
public function testBinomDistArray(
array $expectedResult,
string $values,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomInvTest.php
index ecd12285c..9cddd7462 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/BinomInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class BinomInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBINOMINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBINOMINV')]
public function testBINOMINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('BINOM.INV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class BinomInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BINOMINV.php';
}
- /**
- * @dataProvider providerBinomInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinomInvArray')]
public function testBinomInvArray(
array $expectedResult,
string $trials,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistLeftTailTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistLeftTailTest.php
index ba9e26438..e0581e7f7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistLeftTailTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistLeftTailTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ChiDistLeftTailTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCHIDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHIDIST')]
public function testCHIDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('CHISQ.DIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class ChiDistLeftTailTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/CHIDISTLeftTail.php';
}
- /**
- * @dataProvider providerChiDistLeftTailArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerChiDistLeftTailArray')]
public function testChiDistLeftTailArray(array $expectedResult, string $values, string $degrees): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistRightTailTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistRightTailTest.php
index 94835eb61..b2a3e18f6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistRightTailTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiDistRightTailTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ChiDistRightTailTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCHIDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHIDIST')]
public function testCHIDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('CHISQ.DIST.RT', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class ChiDistRightTailTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/CHIDISTRightTail.php';
}
- /**
- * @dataProvider providerChiDistRightTailArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerChiDistRightTailArray')]
public function testChiDistRightTailArray(array $expectedResult, string $values, string $degrees): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvLeftTailTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvLeftTailTest.php
index 483575756..475cf8887 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvLeftTailTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvLeftTailTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ChiInvLeftTailTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCHIINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHIINV')]
public function testCHIINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('CHISQ.INV', $expectedResult, ...$args);
@@ -36,9 +34,7 @@ class ChiInvLeftTailTest extends AllSetupTeardown
self::assertEqualsWithDelta($probability, $result, 1.0e-8);
}
- /**
- * @dataProvider providerChiInvLeftTailArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerChiInvLeftTailArray')]
public function testChiInvLeftTailArray(array $expectedResult, string $probabilities, string $degrees): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php
index 971ea5515..a09d14be4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiInvRightTailTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ChiInvRightTailTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCHIINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHIINV')]
public function testCHIINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('CHISQ.INV.RT', $expectedResult, ...$args);
@@ -36,9 +34,7 @@ class ChiInvRightTailTest extends AllSetupTeardown
self::assertEqualsWithDelta($probability, $result, 1.0e-8);
}
- /**
- * @dataProvider providerChiInvRightTailArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerChiInvRightTailArray')]
public function testChiInvRightTailArray(array $expectedResult, string $probabilities, string $degrees): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiTestTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiTestTest.php
index 0059a9de8..ea3b2ab0c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiTestTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ChiTestTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
// TODO Convert to Spreadsheet context.
class ChiTestTest extends TestCase
{
- /**
- * @dataProvider providerCHITEST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHITEST')]
public function testCHITEST(mixed $expectedResult, mixed $actual, mixed $expected): void
{
$result = Statistical\Distributions\ChiSquared::test($actual, $expected);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php
index 006ad32eb..2ea9ac53d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ConfidenceTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ConfidenceTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCONFIDENCE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONFIDENCE')]
public function testCONFIDENCE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('CONFIDENCE', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class ConfidenceTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/CONFIDENCE.php';
}
- /**
- * @dataProvider providerConfidenceArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConfidenceArray')]
public function testConfidenceArray(array $expectedResult, string $alpha, string $stdDev, string $size): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php
index e832a89e7..c698cb896 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CorrelTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class CorrelTest extends TestCase
{
- /**
- * @dataProvider providerCORREL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCORREL')]
public function testCORREL(mixed $expectedResult, mixed $xargs, mixed $yargs): void
{
$result = Statistical\Trends::CORREL($xargs, $yargs);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php
index 381b1384d..61e1f1cdf 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class CountATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUNTA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUNTA')]
public function testCOUNTA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('COUNTA', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php
index e5f44f78d..485654761 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountBlankTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Exception as CalcException;
class CountBlankTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUNTBLANK
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUNTBLANK')]
public function testCOUNTBLANK(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('COUNTBLANK', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php
index 794751d6f..a4e803138 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class CountIfTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUNTIF
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUNTIF')]
public function testCOUNTIF(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('COUNTIF', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php
index 54c8a05be..1c589a611 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountIfsTest.php
@@ -7,9 +7,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
// TODO There are some commented out cases which don't return correct value
class CountIfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOUNTIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOUNTIFS')]
public function testCOUNTIFS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('COUNTIFS', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php
index ef951be3f..1074d74ac 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CountTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class CountTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerBasicCOUNT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBasicCOUNT')]
public function testBasicCOUNT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('COUNT', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class CountTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/BasicCOUNT.php';
}
- /**
- * @dataProvider providerExcelCOUNT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExcelCOUNT')]
public function testExcelCOUNT(mixed $expectedResult, mixed ...$args): void
{
if (is_array($args[0])) {
@@ -36,9 +32,7 @@ class CountTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/ExcelCOUNT.php';
}
- /**
- * @dataProvider providerOpenOfficeCOUNT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOpenOfficeCOUNT')]
public function testOpenOfficeCOUNT(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
@@ -54,9 +48,7 @@ class CountTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/OpenOfficeCOUNT.php';
}
- /**
- * @dataProvider providerGnumericCOUNT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGnumericCOUNT')]
public function testGnumericCOUNT(mixed $expectedResult, mixed ...$args): void
{
$this->setGnumeric();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php
index 63b11e8d3..2c7f51a15 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/CovarTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class CovarTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCOVAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCOVAR')]
public function testCOVAR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('COVAR', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/DevSqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/DevSqTest.php
index e239e105a..993723aac 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/DevSqTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/DevSqTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class DevSqTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDEVSQ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDEVSQ')]
public function testDEVSQ(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('DEVSQ', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php
index 2cb5b64cb..516783c6b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ExponDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ExponDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerEXPONDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEXPONDIST')]
public function testEXPONDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('EXPONDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class ExponDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/EXPONDIST.php';
}
- /**
- * @dataProvider providerExponDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExponDistArray')]
public function testExponDistArray(array $expectedResult, string $values, string $lambdas): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FDistTest.php
index 6c6478f28..20aad121a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFDIST')]
public function testFDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('F.DIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class FDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/FDIST.php';
}
- /**
- * @dataProvider providerFDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFDistArray')]
public function testFDistArray(array $expectedResult, string $values, string $u, string $v): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php
index aa3189742..2a5eaaadd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FisherInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFISHERINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFISHERINV')]
public function testFISHERINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('FISHERINV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class FisherInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/FISHERINV.php';
}
- /**
- * @dataProvider providerFisherArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFisherArray')]
public function testFisherArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php
index 352a3afc5..d0f369ebd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/FisherTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FisherTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFISHER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFISHER')]
public function testFISHER(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('FISHER', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class FisherTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/FISHER.php';
}
- /**
- * @dataProvider providerFisherArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFisherArray')]
public function testFisherArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php
index 396e69e0b..8dee25710 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ForecastTest.php
@@ -12,9 +12,7 @@ use PHPUnit\Framework\TestCase;
// Note that null in reference is treated differently than null in array.
class ForecastTest extends TestCase
{
- /**
- * @dataProvider providerFORECAST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFORECAST')]
public function testFORECAST(mixed $expectedResult, mixed ...$args): void
{
$result = Statistical\Trends::FORECAST(...$args);
@@ -26,9 +24,7 @@ class ForecastTest extends TestCase
return require 'tests/data/Calculation/Statistical/FORECAST.php';
}
- /**
- * @dataProvider providerForecastArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerForecastArray')]
public function testForecastArray(array $expectedResult, string $testValues, string $yValues, string $xValues): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php
index 64ef50a5f..0a6379821 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class GammaDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGAMMADIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGAMMADIST')]
public function testGAMMADIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GAMMA.DIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class GammaDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/GAMMADIST.php';
}
- /**
- * @dataProvider providerGammaDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGammaDistArray')]
public function testGammaDistArray(array $expectedResult, string $values, string $alpha, string $beta): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php
index b3d1a3409..1b48f4998 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class GammaInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGAMMAINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGAMMAINV')]
public function testGAMMAINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GAMMA.INV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class GammaInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/GAMMAINV.php';
}
- /**
- * @dataProvider providerGammaInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGammaInvArray')]
public function testGammaInvArray(array $expectedResult, string $values, string $alpha, string $beta): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php
index 8c9c4c76a..d7e47b49a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaLnTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class GammaLnTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGAMMALN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGAMMALN')]
public function testGAMMALN(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GAMMALN', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class GammaLnTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/GAMMALN.php';
}
- /**
- * @dataProvider providerGammaLnArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGammaLnArray')]
public function testGammaLnArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaTest.php
index 9db243cc0..ba246a55a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GammaTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class GammaTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGAMMA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGAMMA')]
public function testGAMMA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GAMMA', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class GammaTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/GAMMA.php';
}
- /**
- * @dataProvider providerGammaArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGammaArray')]
public function testGammaArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GaussTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GaussTest.php
index 4fb98f5ec..528d47bb3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GaussTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GaussTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class GaussTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGAUSS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGAUSS')]
public function testGAUSS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GAUSS', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class GaussTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/GAUSS.php';
}
- /**
- * @dataProvider providerGaussArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGaussArray')]
public function testGaussArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php
index f5b8b91b4..c2fe6b8aa 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GeoMeanTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class GeoMeanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerGEOMEAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGEOMEAN')]
public function testGEOMEAN(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('GEOMEAN', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GrowthTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GrowthTest.php
index 51d379a8d..fc790889c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GrowthTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/GrowthTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
// TODO Run test in spreadsheet context
class GrowthTest extends TestCase
{
- /**
- * @dataProvider providerGROWTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGROWTH')]
public function testGROWTH(mixed $expectedResult, array $yValues, array $xValues, ?array $newValues = null, ?bool $const = null): void
{
if ($newValues === null) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php
index 497f8127c..a991bc985 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HarMeanTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class HarMeanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerHARMEAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHARMEAN')]
public function testHARMEAN(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('HARMEAN', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HypGeomDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HypGeomDistTest.php
index b240d874b..92db287c2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HypGeomDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/HypGeomDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class HypGeomDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerHYPGEOMDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHYPGEOMDIST')]
public function testHYPGEOMDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('HYPGEOMDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class HypGeomDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/HYPGEOMDIST.php';
}
- /**
- * @dataProvider providerHypGeomDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHypGeomDistArray')]
public function testHypGeomDistArray(
array $expectedResult,
string $sampleSuccesses,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php
index c340c9899..0f0cc9a6f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/InterceptTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class InterceptTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerINTERCEPT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerINTERCEPT')]
public function testINTERCEPT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('INTERCEPT', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/KurtTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/KurtTest.php
index 1b2d79168..32d362e2e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/KurtTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/KurtTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class KurtTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerKURT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerKURT')]
public function testKURT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('KURT', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LargeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LargeTest.php
index de1e4aa1e..f3b50da55 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LargeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LargeTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class LargeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLARGE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLARGE')]
public function testLARGE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('LARGE', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php
index d8a3fd8be..e7573b150 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LinEstTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
// TODO run test in spreadsheet context
class LinEstTest extends TestCase
{
- /**
- * @dataProvider providerLINEST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLINEST')]
public function testLINEST(array $expectedResult, array $yValues, array $xValues, mixed $const, mixed $stats): void
{
$result = Statistical\Trends::LINEST($yValues, $xValues, $const, $stats);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php
index 93524d2d0..c6ef9fd25 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogEstTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
// TODO run test in spreadsheet context
class LogEstTest extends TestCase
{
- /**
- * @dataProvider providerLOGEST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOGEST')]
public function testLOGEST(array $expectedResult, array $yValues, array $xValues, mixed $const, mixed $stats): void
{
$result = Statistical\Trends::LOGEST($yValues, $xValues, $const, $stats);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogInvTest.php
index fce4a4b24..25c5bc665 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LogInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOGINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOGINV')]
public function testLOGINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('LOGINV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class LogInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/LOGINV.php';
}
- /**
- * @dataProvider providerLogInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLogInvArray')]
public function testLogInvArray(array $expectedResult, string $probabilities, string $mean, string $stdDev): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDist2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDist2Test.php
index 0857e5424..fd8f3fb4f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDist2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDist2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LogNormDist2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOGNORMDIST2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOGNORMDIST2')]
public function testLOGNORMDIST2(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('LOGNORM.DIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class LogNormDist2Test extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/LOGNORMDIST2.php';
}
- /**
- * @dataProvider providerLogNormDist2Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLogNormDist2Array')]
public function testLogNormDist2Array(array $expectedResult, string $values, string $mean, string $stdDev): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDistTest.php
index fcb01d5a4..4820944a0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/LogNormDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LogNormDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOGNORMDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOGNORMDIST')]
public function testLOGNORMDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('LOGNORMDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class LogNormDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/LOGNORMDIST.php';
}
- /**
- * @dataProvider providerLogNormDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLogNormDistArray')]
public function testLogNormDistArray(array $expectedResult, string $values, string $mean, string $stdDev): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxATest.php
index 4e65e2db4..3d4470144 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MaxATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMAXA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMAXA')]
public function testMAXA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('MAXA', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php
index 25a7ac696..3af46098a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxIfsTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MaxIfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMAXIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMAXIFS')]
public function testMAXIFS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('MAXIFS', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxTest.php
index ea1e5110b..03c0a86d4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MaxTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MaxTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMAX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMAX')]
public function testMAX(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('MAX', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php
index 2eeaf6042..0abb86c2a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MedianTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MedianTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMEDIAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMEDIAN')]
public function testMEDIAN(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('MEDIAN', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinATest.php
index 28d417dae..d825ef517 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MinATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMINA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINA')]
public function testMINA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('MINA', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php
index 7fb91bfbc..44d1dae7f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinIfsTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MinIfsTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMINIFS
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMINIFS')]
public function testMINIFS(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('MINIFS', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinTest.php
index c699cfedf..977715173 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/MinTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class MinTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerMIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMIN')]
public function testMIN(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('MIN', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ModeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ModeTest.php
index 5ae2c4977..a61689fe0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ModeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ModeTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ModeTest extends TestCase
{
- /**
- * @dataProvider providerMODE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMODE')]
public function testMODE(mixed $expectedResult, string $str): void
{
$workbook = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NegBinomDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NegBinomDistTest.php
index 7725556ee..3a83fed89 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NegBinomDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NegBinomDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NegBinomDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNEGBINOMDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNEGBINOMDIST')]
public function testNEGBINOMDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NEGBINOMDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NegBinomDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NEGBINOMDIST.php';
}
- /**
- * @dataProvider providerNegBinomDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNegBinomDistArray')]
public function testNegBinomDistArray(
array $expectedResult,
string $failures,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormDistTest.php
index ba62123ec..f9c444bf8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NormDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNORMDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNORMDIST')]
public function testNORMDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NORMDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NormDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NORMDIST.php';
}
- /**
- * @dataProvider providerNormDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNormDistArray')]
public function testNormDistArray(array $expectedResult, string $values, string $mean, string $stdDev): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormInvTest.php
index 5aa42fc85..14a479c6f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NormInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNORMINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNORMINV')]
public function testNORMINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NORMINV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NormInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NORMINV.php';
}
- /**
- * @dataProvider providerNormInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNormInvArray')]
public function testNormInvArray(array $expectedResult, string $probabilities, string $mean, string $stdDev): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDist2Test.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDist2Test.php
index c85c125c7..ea07827d6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDist2Test.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDist2Test.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NormSDist2Test extends AllSetupTeardown
{
- /**
- * @dataProvider providerNORMSDIST2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNORMSDIST2')]
public function testNORMSDIST2(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NORM.S.DIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NormSDist2Test extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NORMSDIST2.php';
}
- /**
- * @dataProvider providerNormSDist2Array
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNormSDist2Array')]
public function testNormSDist2Array(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDistTest.php
index 95d8ff32d..53b3aafe8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NormSDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNORMSDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNORMSDIST')]
public function testNORMSDIST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NORMSDIST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NormSDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NORMSDIST.php';
}
- /**
- * @dataProvider providerNormSDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNormSDistArray')]
public function testNormSDistArray(array $expectedResult, string $values): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSInvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSInvTest.php
index e93553802..f76312331 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSInvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/NormSInvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class NormSInvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerNORMSINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNORMSINV')]
public function testNORMSINV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('NORMSINV', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class NormSInvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/NORMSINV.php';
}
- /**
- * @dataProvider providerNormSInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNormSInvArray')]
public function testNormSInvArray(array $expectedResult, string $probabilities): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentRankTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentRankTest.php
index 153b76822..b931977b9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentRankTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentRankTest.php
@@ -7,10 +7,9 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class PercentRankTest extends AllSetupTeardown
{
/**
- * @dataProvider providerPERCENTRANK
- *
* @param mixed[] $valueSet
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPERCENTRANK')]
public function testPERCENTRANK(mixed $expectedResult, mixed $valueSet, mixed $value, mixed $digits = null): void
{
if ($digits === null) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentileTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentileTest.php
index 47faff9e3..f3707768e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentileTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PercentileTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class PercentileTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPERCENTILE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPERCENTILE')]
public function testPERCENTILE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('PERCENTILE', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php
index 75a799956..94223ce82 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class PermutTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPERMUT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPERMUT')]
public function testPERMUT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('PERMUT', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class PermutTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/PERMUT.php';
}
- /**
- * @dataProvider providerPermutArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPermutArray')]
public function testPermutArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutationATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutationATest.php
index 2cfc6a567..57cf1169a 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutationATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PermutationATest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class PermutationATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPERMUT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPERMUT')]
public function testPERMUT(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('PERMUTATIONA', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class PermutationATest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/PERMUTATIONA.php';
}
- /**
- * @dataProvider providerPermutationAArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPermutationAArray')]
public function testPermutationAArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PoissonTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PoissonTest.php
index 2233a74ec..23bcbfa67 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PoissonTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/PoissonTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class PoissonTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPOISSON
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPOISSON')]
public function testPOISSON(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('POISSON', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class PoissonTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/POISSON.php';
}
- /**
- * @dataProvider providerPoissonArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPoissonArray')]
public function testPoissonArray(array $expectedResult, string $values, string $mean): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/QuartileTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/QuartileTest.php
index daf658b84..5afdc256e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/QuartileTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/QuartileTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class QuartileTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerQUARTILE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerQUARTILE')]
public function testQUARTILE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('QUARTILE', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RankTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RankTest.php
index 6f2a5ae46..9eeffb958 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RankTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RankTest.php
@@ -7,10 +7,9 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class RankTest extends AllSetupTeardown
{
/**
- * @dataProvider providerRANK
- *
* @param mixed[] $valueSet
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRANK')]
public function testRANK(mixed $expectedResult, mixed $value, array $valueSet, mixed $order = null): void
{
if ($order === null) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php
index fba99b1b8..49fa2541f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/RsqTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class RsqTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerRSQ
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRSQ')]
public function testRSQ(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('RSQ', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SkewTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SkewTest.php
index f88287cc3..fad689b61 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SkewTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SkewTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class SkewTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSKEW
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSKEW')]
public function testSKEW(mixed $expectedResult, array $args): void
{
$this->runTestCaseReference('SKEW', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php
index 12220561b..e7ae4e320 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SlopeTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class SlopeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSLOPE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSLOPE')]
public function testSLOPE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseNoBracket('SLOPE', $expectedResult, ...$args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SmallTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SmallTest.php
index 13dc6f99c..25cf80b31 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SmallTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SmallTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class SmallTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSMALL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSMALL')]
public function testSMALL(mixed $expectedResult, mixed $values, mixed $position): void
{
$this->runTestCaseReference('SMALL', $expectedResult, $values, $position);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevATest.php
index c6964f948..5971dbb49 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class StDevATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTDEVA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTDEVA')]
public function testSTDEVA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('STDEVA', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class StDevATest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/STDEVA.php';
}
- /**
- * @dataProvider providerOdsSTDEVA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsSTDEVA')]
public function testOdsSTDEVA(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPATest.php
index db309b2f7..6c1d5e7c2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class StDevPATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTDEVPA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTDEVPA')]
public function testSTDEVPA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('STDEVPA', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class StDevPATest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/STDEVPA.php';
}
- /**
- * @dataProvider providerOdsSTDEVPA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsSTDEVPA')]
public function testOdsSTDEVPA(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPTest.php
index 89898d2a1..e3d067d67 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevPTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class StDevPTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTDEVP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTDEVP')]
public function testSTDEVP(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('STDEVP', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class StDevPTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/STDEVP.php';
}
- /**
- * @dataProvider providerOdsSTDEVP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsSTDEVP')]
public function testOdsSTDEVP(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevTest.php
index b92062153..b0712dcb5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StDevTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class StDevTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTDEV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTDEV')]
public function testSTDEV(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('STDEV', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class StDevTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/STDEV.php';
}
- /**
- * @dataProvider providerOdsSTDEV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsSTDEV')]
public function testOdsSTDEV(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StandardizeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StandardizeTest.php
index 8defe4c03..02846869d 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StandardizeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/StandardizeTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class StandardizeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTANDARDIZE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTANDARDIZE')]
public function testSTANDARDIZE(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('STANDARDIZE', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class StandardizeTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/STANDARDIZE.php';
}
- /**
- * @dataProvider providerStandardizeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerStandardizeArray')]
public function testStandardizeArray(array $expectedResult, string $argument1, string $argument2, string $argument3): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php
index 5c195630a..9cabfe0bd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/SteyxTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class SteyxTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSTEYX
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSTEYX')]
public function testSTEYX(mixed $expectedResult, array $xargs, array $yargs): void
{
//$result = Statistical\Trends::STEYX($xargs, $yargs);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php
index c57deb266..19811cf23 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TDistTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TDistTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTDIST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTDIST')]
public function testTDIST(mixed $expectedResult, mixed $value, mixed $degrees, mixed $tails): void
{
$this->runTestCaseReference('TDIST', $expectedResult, $value, $degrees, $tails);
@@ -21,9 +19,7 @@ class TDistTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/TDIST.php';
}
- /**
- * @dataProvider providerTDistArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTDistArray')]
public function testTDistArray(array $expectedResult, string $values, string $degrees, string $tails): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php
index ed16e9dba..bdbabebfb 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TinvTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TinvTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTINV
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTINV')]
public function testTINV(mixed $expectedResult, mixed $probability, mixed $degrees): void
{
$this->runTestCaseReference('TINV', $expectedResult, $probability, $degrees);
@@ -21,9 +19,7 @@ class TinvTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/TINV.php';
}
- /**
- * @dataProvider providerTInvArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTInvArray')]
public function testTInvArray(array $expectedResult, string $values, string $degrees): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrendTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrendTest.php
index 1a09ce9b4..a9ee4a33f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrendTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrendTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
// TODO Run test in spreadsheet context.
class TrendTest extends TestCase
{
- /**
- * @dataProvider providerGROWTH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGROWTH')]
public function testTREND(mixed $expectedResult, array $yValues, array $xValues, ?array $newValues = null, ?bool $const = null): void
{
if ($newValues === null) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrimMeanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrimMeanTest.php
index 1e6adfdcb..b267e5c64 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrimMeanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/TrimMeanTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class TrimMeanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTRIMMEAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTRIMMEAN')]
public function testTRIMMEAN(mixed $expectedResult, array $args, mixed $percentage): void
{
$this->runTestCaseReference('TRIMMEAN', $expectedResult, $args, $percentage);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarATest.php
index 084a452e4..bf39c05b8 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class VarATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerVARA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVARA')]
public function testVARA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('VARA', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class VarATest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/VARA.php';
}
- /**
- * @dataProvider providerOdsVARA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsVARA')]
public function testOdsVARA(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPATest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPATest.php
index 9c1e62fdb..73b260003 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPATest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPATest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class VarPATest extends AllSetupTeardown
{
- /**
- * @dataProvider providerVARPA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVARPA')]
public function testVARPA(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('VARPA', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class VarPATest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/VARPA.php';
}
- /**
- * @dataProvider providerOdsVARPA
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsVARPA')]
public function testOdsVARPA(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPTest.php
index 45f46d08b..fb85dc077 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarPTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class VarPTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerVARP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVARP')]
public function testVARP(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('VARP', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class VarPTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/VARP.php';
}
- /**
- * @dataProvider providerOdsVARP
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsVARP')]
public function testOdsVARP(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarTest.php
index c565b4177..0b3d8c9f7 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/VarTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\Statistical;
class VarTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerVAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVAR')]
public function testVAR(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('VAR', $expectedResult, ...$args);
@@ -19,9 +17,7 @@ class VarTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/VAR.php';
}
- /**
- * @dataProvider providerOdsVAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOdsVAR')]
public function testOdsVAR(mixed $expectedResult, mixed ...$args): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php
index 533477525..66d9e9275 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/WeibullTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class WeibullTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerWEIBULL
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEIBULL')]
public function testWEIBULL(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCases('WEIBULL', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class WeibullTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/WEIBULL.php';
}
- /**
- * @dataProvider providerWeibullArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWeibullArray')]
public function testWeibullArray(array $expectedResult, string $values, string $alpha, string $beta): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php
index 32ae58a1c..b76f36b7f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Statistical/ZTestTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ZTestTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerZTEST
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerZTEST')]
public function testZTEST(mixed $expectedResult, mixed ...$args): void
{
$this->runTestCaseReference('ZTEST', $expectedResult, ...$args);
@@ -21,9 +19,7 @@ class ZTestTest extends AllSetupTeardown
return require 'tests/data/Calculation/Statistical/ZTEST.php';
}
- /**
- * @dataProvider providerZTestArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerZTestArray')]
public function testZTestArray(array $expectedResult, string $dataSet, string $m0): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ArrayToTextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ArrayToTextTest.php
index 56d035729..a65b3a18f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ArrayToTextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ArrayToTextTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
class ArrayToTextTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerARRAYTOTEXT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerARRAYTOTEXT')]
public function testArrayToText(string $expectedResult, array $testData, int $mode): void
{
$worksheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharNonPrintableTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharNonPrintableTest.php
index 370ec308c..5dd049a2c 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharNonPrintableTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharNonPrintableTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
class CharNonPrintableTest extends AbstractFunctional
{
- /**
- * @dataProvider providerType
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerType')]
public function testNotPrintable(string $type): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php
index e9549e452..4782e9d66 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CharTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CharTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCHAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCHAR')]
public function testCHAR(mixed $expectedResult, mixed $character = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -30,9 +28,7 @@ class CharTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/CHAR.php';
}
- /**
- * @dataProvider providerCharArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCharArray')]
public function testCharArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php
index 7b83438cd..196f5a8d5 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CleanTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CleanTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCLEAN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCLEAN')]
public function testCLEAN(mixed $expectedResult, mixed $value = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -30,9 +28,7 @@ class CleanTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/CLEAN.php';
}
- /**
- * @dataProvider providerCleanArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCleanArray')]
public function testCleanArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php
index e29c057a6..c1ff8d8ca 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/CodeTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class CodeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCODE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCODE')]
public function testCODE(mixed $expectedResult, mixed $character = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -30,9 +28,7 @@ class CodeTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/CODE.php';
}
- /**
- * @dataProvider providerCodeArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCodeArray')]
public function testCodeArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatTest.php
index 3e0c88f09..3438e1431 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
class ConcatTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCONCAT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONCAT')]
public function testCONCAT(mixed $expectedResult, mixed ...$args): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateGnumericTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateGnumericTest.php
index 2b4f12a2f..9f2697fae 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateGnumericTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateGnumericTest.php
@@ -10,9 +10,8 @@ class ConcatenateGnumericTest extends AllSetupTeardown
{
/**
* Gnumeric, unlike Excel or LibreOffice, implements CONCATENATE like CONCAT.
- *
- * @dataProvider providerCONCAT
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONCAT')]
public function testCONCATENATE(mixed $expectedResult, mixed ...$args): void
{
self::setGnumeric();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php
index 3a5f33cff..7e2cfb295 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ConcatenateTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
class ConcatenateTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerCONCATENATE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCONCATENATE')]
public function testCONCATENATE(mixed $expectedResult, mixed ...$args): void
{
$this->mightHaveException($expectedResult);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php
index 19c9dc3b6..c383285fd 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/DollarTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class DollarTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerDOLLAR
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDOLLAR')]
public function testDOLLAR(mixed $expectedResult, mixed $amount = 'omitted', mixed $decimals = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -34,9 +32,7 @@ class DollarTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/DOLLAR.php';
}
- /**
- * @dataProvider providerDollarArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDollarArray')]
public function testDollarArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php
index 802b73e4c..9f3a15f63 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ExactTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ExactTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerEXACT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEXACT')]
public function testEXACT(mixed $expectedResult, mixed $string1 = 'omitted', mixed $string2 = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -34,9 +32,7 @@ class ExactTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/EXACT.php';
}
- /**
- * @dataProvider providerExactArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExactArray')]
public function testExactArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php
index 6f5e187b8..5497f69c9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FindTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FindTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFIND
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFIND')]
public function testFIND(mixed $expectedResult, mixed $string1 = 'omitted', mixed $string2 = 'omitted', mixed $start = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +37,7 @@ class FindTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/FIND.php';
}
- /**
- * @dataProvider providerFindArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFindArray')]
public function testFindArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php
index 0ee5c1cc3..a9ad67712 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/FixedTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class FixedTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerFIXED
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFIXED')]
public function testFIXED(mixed $expectedResult, mixed $number = 'omitted', mixed $decimals = 'omitted', mixed $noCommas = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +37,7 @@ class FixedTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/FIXED.php';
}
- /**
- * @dataProvider providerFixedArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFixedArray')]
public function testFixedArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php
index 94ac23fd4..f59e53311 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LeftTest.php
@@ -11,11 +11,10 @@ use PhpOffice\PhpSpreadsheet\Settings;
class LeftTest extends AllSetupTeardown
{
/**
- * @dataProvider providerLEFT
- *
* @param mixed $str string from which to extract
* @param mixed $cnt number of characters to extract
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLEFT')]
public function testLEFT(mixed $expectedResult, mixed $str = 'omitted', mixed $cnt = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +38,7 @@ class LeftTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/LEFT.php';
}
- /**
- * @dataProvider providerLocaleLEFT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleLEFT')]
public function testLowerWithLocaleBoolean(string $expectedResult, string $locale, mixed $value, mixed $characters): void
{
$newLocale = Settings::setLocale($locale);
@@ -71,9 +68,7 @@ class LeftTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeLEFTTrue
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeLEFTTrue')]
public function testCalculationTypeTrue(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -107,9 +102,7 @@ class LeftTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeLEFTFalse
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeLEFTFalse')]
public function testCalculationTypeFalse(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -143,9 +136,7 @@ class LeftTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeLEFTNull
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeLEFTNull')]
public function testCalculationTypeNull(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -178,9 +169,7 @@ class LeftTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerLeftArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLeftArray')]
public function testLeftArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php
index e2db773ae..029a51010 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LenTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class LenTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLEN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLEN')]
public function testLEN(mixed $expectedResult, mixed $str = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -30,9 +28,7 @@ class LenTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/LEN.php';
}
- /**
- * @dataProvider providerLenArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLenArray')]
public function testLenArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php
index 279332c6f..e254c07c9 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/LowerTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\Settings;
class LowerTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerLOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLOWER')]
public function testLOWER(mixed $expectedResult, mixed $str = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -31,9 +29,7 @@ class LowerTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/LOWER.php';
}
- /**
- * @dataProvider providerLocaleLOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleLOWER')]
public function testLowerWithLocaleBoolean(string $expectedResult, string $locale, mixed $value): void
{
$newLocale = Settings::setLocale($locale);
@@ -61,9 +57,7 @@ class LowerTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerLowerArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLowerArray')]
public function testLowerArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php
index 364fb1686..2b36d8cf4 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/MidTest.php
@@ -11,12 +11,11 @@ use PhpOffice\PhpSpreadsheet\Settings;
class MidTest extends AllSetupTeardown
{
/**
- * @dataProvider providerMID
- *
* @param mixed $str string from which to extract
* @param mixed $start position at which to start
* @param mixed $cnt number of characters to extract
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMID')]
public function testMID(mixed $expectedResult, mixed $str = 'omitted', mixed $start = 'omitted', mixed $cnt = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -45,9 +44,7 @@ class MidTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/MID.php';
}
- /**
- * @dataProvider providerLocaleMID
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleMID')]
public function testMiddleWithLocaleBoolean(string $expectedResult, string $locale, mixed $value, mixed $offset, mixed $characters): void
{
$newLocale = Settings::setLocale($locale);
@@ -78,9 +75,7 @@ class MidTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeMIDTrue
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeMIDTrue')]
public function testCalculationTypeTrue(string $type, string $resultB1, string $resultB2, string $resultB3): void
{
Functions::setCompatibilityMode($type);
@@ -119,9 +114,7 @@ class MidTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeMIDFalse
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeMIDFalse')]
public function testCalculationTypeFalse(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -159,9 +152,7 @@ class MidTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeMIDNull
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeMIDNull')]
public function testCalculationTypeNull(string $type, string $resultB1, string $resultB2, string $resultB3): void
{
Functions::setCompatibilityMode($type);
@@ -199,9 +190,7 @@ class MidTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerMidArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMidArray')]
public function testMidArray(array $expectedResult, string $argument1, string $argument2, string $argument3): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php
index 9dfa1fa20..15afdcd63 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php
@@ -10,9 +10,7 @@ class NumberValueTest extends AllSetupTeardown
{
const NV_PRECISION = 1.0E-8;
- /**
- * @dataProvider providerNUMBERVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNUMBERVALUE')]
public function testNUMBERVALUE(mixed $expectedResult, mixed $number = 'omitted', mixed $decimal = 'omitted', mixed $group = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -41,9 +39,7 @@ class NumberValueTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/NUMBERVALUE.php';
}
- /**
- * @dataProvider providerNumberValueArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberValueArray')]
public function testNumberValueArray(array $expectedResult, string $argument1, string $argument2, string $argument3): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/OpenOfficeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/OpenOfficeTest.php
index c7af96f64..5a73568b6 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/OpenOfficeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/OpenOfficeTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
class OpenOfficeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerOpenOffice
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOpenOffice')]
public function testOpenOffice(mixed $expectedResult, string $formula): void
{
$this->setOpenOffice();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php
index 6df021fe6..3767f9118 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ProperTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\Settings;
class ProperTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerPROPER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPROPER')]
public function testPROPER(mixed $expectedResult, mixed $str = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -31,9 +29,7 @@ class ProperTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/PROPER.php';
}
- /**
- * @dataProvider providerLocaleLOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleLOWER')]
public function testLowerWithLocaleBoolean(string $expectedResult, string $locale, mixed $value): void
{
$newLocale = Settings::setLocale($locale);
@@ -61,9 +57,7 @@ class ProperTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerProperArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerProperArray')]
public function testProperArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php
index 68a6f501e..8478bb69b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReplaceTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ReplaceTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerREPLACE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerREPLACE')]
public function testREPLACE(mixed $expectedResult, mixed $oldText = 'omitted', mixed $start = 'omitted', mixed $count = 'omitted', mixed $newText = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -45,9 +43,7 @@ class ReplaceTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/REPLACE.php';
}
- /**
- * @dataProvider providerReplaceArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerReplaceArray')]
public function testReplaceArray(
array $expectedResult,
string $oldText,
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReptTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReptTest.php
index 8cbed14d3..3a04a346f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReptTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ReptTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class ReptTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerREPT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerREPT')]
public function testReptThroughEngine(mixed $expectedResult, mixed $val = 'omitted', mixed $rpt = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -34,9 +32,7 @@ class ReptTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/REPT.php';
}
- /**
- * @dataProvider providerReptArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerReptArray')]
public function testReptArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php
index 1ecc051fc..007ad28c2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/RightTest.php
@@ -11,11 +11,10 @@ use PhpOffice\PhpSpreadsheet\Settings;
class RightTest extends AllSetupTeardown
{
/**
- * @dataProvider providerRIGHT
- *
* @param mixed $str string from which to extract
* @param mixed $cnt number of characters to extract
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRIGHT')]
public function testRIGHT(mixed $expectedResult, mixed $str = 'omitted', mixed $cnt = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +38,7 @@ class RightTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/RIGHT.php';
}
- /**
- * @dataProvider providerLocaleRIGHT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleRIGHT')]
public function testLowerWithLocaleBoolean(string $expectedResult, string $locale, mixed $value, mixed $characters): void
{
$newLocale = Settings::setLocale($locale);
@@ -71,9 +68,7 @@ class RightTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeRIGHTTrue
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeRIGHTTrue')]
public function testCalculationTypeTrue(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -107,9 +102,7 @@ class RightTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeRIGHTFalse
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeRIGHTFalse')]
public function testCalculationTypeFalse(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -143,9 +136,7 @@ class RightTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerCalculationTypeRIGHTNull
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculationTypeRIGHTNull')]
public function testCalculationTypeNull(string $type, string $resultB1, string $resultB2): void
{
Functions::setCompatibilityMode($type);
@@ -178,9 +169,7 @@ class RightTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerRightArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRightArray')]
public function testRightArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php
index 5c441b7dd..656762cb3 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SearchTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SearchTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSEARCH
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSEARCH')]
public function testSEARCH(mixed $expectedResult, mixed $findText = 'omitted', mixed $withinText = 'omitted', mixed $start = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -39,9 +37,7 @@ class SearchTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/SEARCH.php';
}
- /**
- * @dataProvider providerSearchArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSearchArray')]
public function testSearchArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php
index 927330252..51bce11af 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/SubstituteTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class SubstituteTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerSUBSTITUTE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSUBSTITUTE')]
public function testSUBSTITUTE(mixed $expectedResult, mixed $text = 'omitted', mixed $oldText = 'omitted', mixed $newText = 'omitted', mixed $instance = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -45,9 +43,7 @@ class SubstituteTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/SUBSTITUTE.php';
}
- /**
- * @dataProvider providerSubstituteArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSubstituteArray')]
public function testSubstituteArray(array $expectedResult, string $oldText, string $fromText, string $toText): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php
index 6f2bf123a..46886d5bc 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerT')]
public function testT(mixed $expectedResult, mixed $value = 'no arguments'): void
{
$this->mightHaveException($expectedResult);
@@ -29,9 +27,7 @@ class TTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/T.php';
}
- /**
- * @dataProvider providerTArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTArray')]
public function testTArray(array $expectedResult, string $argument): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextAfterTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextAfterTest.php
index 9f50af3ef..ea3c38f8e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextAfterTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextAfterTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
class TextAfterTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTEXTAFTER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTEXTAFTER')]
public function testTextAfter(string $expectedResult, array $arguments): void
{
$text = $arguments[0];
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextBeforeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextBeforeTest.php
index 05f0715ee..d49457317 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextBeforeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextBeforeTest.php
@@ -6,9 +6,7 @@ namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\TextData;
class TextBeforeTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTEXTBEFORE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTEXTBEFORE')]
public function testTextBefore(string $expectedResult, array $arguments): void
{
$text = $arguments[0];
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php
index e9a231a05..6a23a1550 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextJoinTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TextJoinTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTEXTJOIN
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTEXTJOIN')]
public function testTEXTJOIN(mixed $expectedResult, array $args): void
{
$this->mightHaveException($expectedResult);
@@ -35,9 +33,7 @@ class TextJoinTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/TEXTJOIN.php';
}
- /**
- * @dataProvider providerTextjoinArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTextjoinArray')]
public function testTextjoinArray(array $expectedResult, string $delimiter, string $blanks, string $texts): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextSplitTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextSplitTest.php
index 91f90fad8..9ac0c9465 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextSplitTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextSplitTest.php
@@ -26,9 +26,7 @@ class TextSplitTest extends AllSetupTeardown
}
}
- /**
- * @dataProvider providerTEXTSPLIT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTEXTSPLIT')]
public function testTextSplit(array $expectedResult, array $arguments): void
{
Calculation::getInstance($this->getSpreadsheet())->setInstanceArrayReturnType(Calculation::RETURN_ARRAY_AS_ARRAY);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php
index eedd8b93b..111d8cd9b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TextTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TextTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTEXT
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTEXT')]
public function testTEXT(mixed $expectedResult, mixed $value = 'omitted', mixed $format = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -34,9 +32,7 @@ class TextTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/TEXT.php';
}
- /**
- * @dataProvider providerTextArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTextArray')]
public function testTextArray(array $expectedResult, string $argument1, string $argument2): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php
index 30929afd9..32c10329b 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/TrimTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
class TrimTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerTRIM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTRIM')]
public function testTRIM(mixed $expectedResult, mixed $character = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -30,9 +28,7 @@ class TrimTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/TRIM.php';
}
- /**
- * @dataProvider providerTrimArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTrimArray')]
public function testTrimArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php
index 7522373da..9d6b2210e 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/UpperTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\Settings;
class UpperTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerUPPER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUPPER')]
public function testUPPER(mixed $expectedResult, mixed $str = 'omitted'): void
{
$this->mightHaveException($expectedResult);
@@ -31,9 +29,7 @@ class UpperTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/UPPER.php';
}
- /**
- * @dataProvider providerLocaleLOWER
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocaleLOWER')]
public function testLowerWithLocaleBoolean(string $expectedResult, string $locale, mixed $value): void
{
$newLocale = Settings::setLocale($locale);
@@ -61,9 +57,7 @@ class UpperTest extends AllSetupTeardown
];
}
- /**
- * @dataProvider providerUpperArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUpperArray')]
public function testUpperArray(array $expectedResult, string $array): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php
index 2df5db47b..124df5278 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueTest.php
@@ -17,9 +17,7 @@ class ValueTest extends AllSetupTeardown
StringHelper::setThousandsSeparator(null);
}
- /**
- * @dataProvider providerVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVALUE')]
public function testVALUE(mixed $expectedResult, mixed $value = 'omitted'): void
{
StringHelper::setDecimalSeparator('.');
@@ -43,9 +41,7 @@ class ValueTest extends AllSetupTeardown
return require 'tests/data/Calculation/TextData/VALUE.php';
}
- /**
- * @dataProvider providerValueArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerValueArray')]
public function testValueArray(array $expectedResult, string $argument): void
{
$calculation = Calculation::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueToTextTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueToTextTest.php
index 37c33701e..337fd0355 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueToTextTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/TextData/ValueToTextTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheet\RichText\RichText;
class ValueToTextTest extends AllSetupTeardown
{
- /**
- * @dataProvider providerVALUE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVALUE')]
public function testVALUETOTEXT(mixed $expectedResult, mixed $value, int|string $format): void
{
$sheet = $this->getSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Web/UrlEncodeTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Web/UrlEncodeTest.php
index 8ab1337f1..21a3becd2 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Web/UrlEncodeTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Web/UrlEncodeTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class UrlEncodeTest extends TestCase
{
- /**
- * @dataProvider providerURLENCODE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerURLENCODE')]
public function testURLENCODE(string $expectedResult, mixed $text): void
{
$result = Service::urlEncode($text);
diff --git a/tests/PhpSpreadsheetTests/Calculation/Functions/Web/WebServiceTest.php b/tests/PhpSpreadsheetTests/Calculation/Functions/Web/WebServiceTest.php
index 48c528c6a..812ad8a05 100644
--- a/tests/PhpSpreadsheetTests/Calculation/Functions/Web/WebServiceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/Functions/Web/WebServiceTest.php
@@ -26,9 +26,7 @@ class WebServiceTest extends TestCase
Settings::unsetHttpClient();
}
- /**
- * @dataProvider providerWEBSERVICE
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWEBSERVICE')]
public function testWEBSERVICE(string $expectedResult, string $url, ?array $responseData): void
{
if (!empty($responseData)) {
diff --git a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php
index 71f400dc2..f1795b238 100644
--- a/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/FunctionsTest.php
@@ -71,9 +71,7 @@ class FunctionsTest extends TestCase
self::assertEquals('#Not Yet Implemented', $result);
}
- /**
- * @dataProvider providerIfCondition
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIfCondition')]
public function testIfCondition(string $expectedResult, string $args): void
{
$result = Functions::ifCondition($args);
diff --git a/tests/PhpSpreadsheetTests/Calculation/InternalFunctionsTest.php b/tests/PhpSpreadsheetTests/Calculation/InternalFunctionsTest.php
index 093922d13..0175e7b78 100644
--- a/tests/PhpSpreadsheetTests/Calculation/InternalFunctionsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/InternalFunctionsTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class InternalFunctionsTest extends TestCase
{
- /**
- * @dataProvider anchorArrayDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('anchorArrayDataProvider')]
public function testAnchorArrayFormula(string $reference, string $range, array $expectedResult): void
{
$spreadsheet = new Spreadsheet();
@@ -51,9 +49,7 @@ class InternalFunctionsTest extends TestCase
];
}
- /**
- * @dataProvider singleDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('singleDataProvider')]
public function testSingleArrayFormula(string $reference, mixed $expectedResult): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/MergedCellTest.php b/tests/PhpSpreadsheetTests/Calculation/MergedCellTest.php
index efaefc9a0..2c8849ece 100644
--- a/tests/PhpSpreadsheetTests/Calculation/MergedCellTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/MergedCellTest.php
@@ -12,9 +12,7 @@ use PHPUnit\Framework\TestCase;
class MergedCellTest extends TestCase
{
- /**
- * @dataProvider providerWorksheetFormulaeColumns
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWorksheetFormulaeColumns')]
public function testMergedCellColumns(string $formula, mixed $expectedResult): void
{
$spreadSheet = new Spreadsheet();
@@ -52,9 +50,7 @@ class MergedCellTest extends TestCase
];
}
- /**
- * @dataProvider providerWorksheetFormulaeRows
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerWorksheetFormulaeRows')]
public function testMergedCellRows(string $formula, mixed $expectedResult): void
{
$spreadSheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/MissingArgumentsTest.php b/tests/PhpSpreadsheetTests/Calculation/MissingArgumentsTest.php
index e57d0cd04..c9f994aa0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/MissingArgumentsTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/MissingArgumentsTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class MissingArgumentsTest extends TestCase
{
- /**
- * @dataProvider providerMissingArguments
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMissingArguments')]
public function testMissingArguments(mixed $expected, string $formula): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/ParseFormulaTest.php b/tests/PhpSpreadsheetTests/Calculation/ParseFormulaTest.php
index 0a8d2105d..4e06f9ca0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/ParseFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/ParseFormulaTest.php
@@ -12,9 +12,7 @@ use PHPUnit\Framework\TestCase;
class ParseFormulaTest extends TestCase
{
- /**
- * @dataProvider providerBinaryOperations
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBinaryOperations')]
public function testParseOperations(array $expectedStack, string $formula): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/RefErrorTest.php b/tests/PhpSpreadsheetTests/Calculation/RefErrorTest.php
index 657d79fbb..3054a3d40 100644
--- a/tests/PhpSpreadsheetTests/Calculation/RefErrorTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/RefErrorTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class RefErrorTest extends TestCase
{
- /**
- * @dataProvider providerRefError
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRefError')]
public function testRefError(mixed $expected, string $formula): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/RowColumnReferenceTest.php b/tests/PhpSpreadsheetTests/Calculation/RowColumnReferenceTest.php
index e34f8c87e..1a1cfa88f 100644
--- a/tests/PhpSpreadsheetTests/Calculation/RowColumnReferenceTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/RowColumnReferenceTest.php
@@ -35,9 +35,7 @@ class RowColumnReferenceTest extends TestCase
$this->spreadSheet->setActiveSheetIndexByName('summary sheet');
}
- /**
- * @dataProvider providerCurrentWorksheetFormulae
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCurrentWorksheetFormulae')]
public function testCurrentWorksheet(string $formula, float $expectedResult): void
{
$worksheet = $this->spreadSheet->getActiveSheet();
diff --git a/tests/PhpSpreadsheetTests/Calculation/StructuredReferenceFormulaTest.php b/tests/PhpSpreadsheetTests/Calculation/StructuredReferenceFormulaTest.php
index 0c917a658..8327e03b0 100644
--- a/tests/PhpSpreadsheetTests/Calculation/StructuredReferenceFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/StructuredReferenceFormulaTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class StructuredReferenceFormulaTest extends TestCase
{
- /**
- * @dataProvider structuredReferenceProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('structuredReferenceProvider')]
public function testStructuredReferences(float $expectedValue, string $cellAddress): void
{
$inputFileType = 'Xlsx';
diff --git a/tests/PhpSpreadsheetTests/Calculation/TranslationTest.php b/tests/PhpSpreadsheetTests/Calculation/TranslationTest.php
index a3b846023..e1ab28f29 100644
--- a/tests/PhpSpreadsheetTests/Calculation/TranslationTest.php
+++ b/tests/PhpSpreadsheetTests/Calculation/TranslationTest.php
@@ -33,9 +33,7 @@ class TranslationTest extends TestCase
Settings::setLocale($this->locale);
}
- /**
- * @dataProvider providerTranslations
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTranslations')]
public function testTranslation(string $expectedResult, string $locale, string $formula): void
{
$validLocale = Settings::setLocale($locale);
diff --git a/tests/PhpSpreadsheetTests/Cell/AddressHelperTest.php b/tests/PhpSpreadsheetTests/Cell/AddressHelperTest.php
index 7b41d8bd2..b82328679 100644
--- a/tests/PhpSpreadsheetTests/Cell/AddressHelperTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/AddressHelperTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class AddressHelperTest extends TestCase
{
- /**
- * @dataProvider providerR1C1ConversionToA1Absolute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerR1C1ConversionToA1Absolute')]
public function testR1C1ConversionToA1Absolute(string $expectedValue, string $address): void
{
$actualValue = AddressHelper::convertToA1($address);
@@ -25,9 +23,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/R1C1ConversionToA1Absolute.php';
}
- /**
- * @dataProvider providerR1C1ConversionToA1Relative
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerR1C1ConversionToA1Relative')]
public function testR1C1ConversionToA1Relative(
string $expectedValue,
string $address,
@@ -54,9 +50,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/R1C1ConversionToA1Relative.php';
}
- /**
- * @dataProvider providerR1C1ConversionToA1Exception
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerR1C1ConversionToA1Exception')]
public function testR1C1ConversionToA1Exception(string $address): void
{
$this->expectException(Exception::class);
@@ -69,9 +63,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/R1C1ConversionToA1Exception.php';
}
- /**
- * @dataProvider providerA1ConversionToR1C1Absolute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerA1ConversionToR1C1Absolute')]
public function testA1ConversionToR1C1Absolute(string $expectedValue, string $address): void
{
$actualValue = AddressHelper::convertToR1C1($address);
@@ -84,9 +76,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/A1ConversionToR1C1Absolute.php';
}
- /**
- * @dataProvider providerA1ConversionToR1C1Relative
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerA1ConversionToR1C1Relative')]
public function testA1ConversionToR1C1Relative(string $expectedValue, string $address, ?int $row = null, ?int $column = null): void
{
$actualValue = AddressHelper::convertToR1C1($address, $row, $column);
@@ -99,9 +89,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/A1ConversionToR1C1Relative.php';
}
- /**
- * @dataProvider providerA1ConversionToR1C1Exception
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerA1ConversionToR1C1Exception')]
public function testA1ConversionToR1C1Exception(string $address): void
{
$this->expectException(Exception::class);
@@ -114,9 +102,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/A1ConversionToR1C1Exception.php';
}
- /**
- * @dataProvider providerConvertFormulaToA1FromSpreadsheetXml
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertFormulaToA1FromSpreadsheetXml')]
public function testConvertFormulaToA1SpreadsheetXml(string $expectedValue, string $formula): void
{
$actualValue = AddressHelper::convertFormulaToA1($formula);
@@ -129,9 +115,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/ConvertFormulaToA1FromSpreadsheetXml.php';
}
- /**
- * @dataProvider providerConvertFormulaToA1FromR1C1Absolute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertFormulaToA1FromR1C1Absolute')]
public function testConvertFormulaToA1R1C1Absolute(string $expectedValue, string $formula): void
{
$actualValue = AddressHelper::convertFormulaToA1($formula);
@@ -144,9 +128,7 @@ class AddressHelperTest extends TestCase
return require 'tests/data/Cell/ConvertFormulaToA1FromR1C1Absolute.php';
}
- /**
- * @dataProvider providerConvertFormulaToA1FromR1C1Relative
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertFormulaToA1FromR1C1Relative')]
public function testConvertFormulaToA1FromR1C1Relative(string $expectedValue, string $formula, int $row, int $column): void
{
$actualValue = AddressHelper::convertFormulaToA1($formula, $row, $column);
diff --git a/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php
index d8de97a33..bf34a40ca 100644
--- a/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/AdvancedValueBinderTest.php
@@ -84,9 +84,7 @@ class AdvancedValueBinderTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider currencyProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('currencyProvider')]
public function testCurrency(string $value, float $valueBinded, string $thousandsSeparator, string $decimalSeparator, string $currencyCode): void
{
StringHelper::setCurrencyCode($currencyCode);
@@ -121,9 +119,7 @@ class AdvancedValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider fractionProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('fractionProvider')]
public function testFractions(mixed $value, mixed $valueBinded): void
{
$spreadsheet = new Spreadsheet();
@@ -160,9 +156,7 @@ class AdvancedValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider percentageProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('percentageProvider')]
public function testPercentages(mixed $value, mixed $valueBinded): void
{
$spreadsheet = new Spreadsheet();
@@ -187,9 +181,7 @@ class AdvancedValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider timeProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('timeProvider')]
public function testTimes(mixed $value, mixed $valueBinded): void
{
$spreadsheet = new Spreadsheet();
@@ -212,9 +204,7 @@ class AdvancedValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider stringProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('stringProvider')]
public function testStringWrapping(string $value): void
{
$spreadsheet = new Spreadsheet();
@@ -234,9 +224,7 @@ class AdvancedValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider formulaProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('formulaProvider')]
public function testFormula(string $value, string $dataType): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Cell/CellAddressTest.php b/tests/PhpSpreadsheetTests/Cell/CellAddressTest.php
index 3cb204b3f..e0e030e8e 100644
--- a/tests/PhpSpreadsheetTests/Cell/CellAddressTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/CellAddressTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class CellAddressTest extends TestCase
{
- /**
- * @dataProvider providerCreateFromCellAddress
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromCellAddress')]
public function testCreateFromCellAddress(
string $cellAddress,
string $expectedColumnName,
@@ -38,9 +36,7 @@ class CellAddressTest extends TestCase
];
}
- /**
- * @dataProvider providerCreateFromCellAddressException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromCellAddressException')]
public function testCreateFromCellAddressException(string $cellAddress): void
{
$this->expectException(Exception::class);
@@ -63,9 +59,7 @@ class CellAddressTest extends TestCase
];
}
- /**
- * @dataProvider providerCreateFromColumnAndRow
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromColumnAndRow')]
public function testCreateFromColumnAndRow(
int $columnId,
int $rowId,
@@ -81,9 +75,7 @@ class CellAddressTest extends TestCase
self::assertSame($expectedColumnName, $cellAddressObject->columnName());
}
- /**
- * @dataProvider providerCreateFromColumnRowException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromColumnRowException')]
public function testCreateFromColumnRowException(int|string $columnId, int|string $rowId): void
{
$this->expectException(Exception::class);
@@ -101,9 +93,7 @@ class CellAddressTest extends TestCase
];
}
- /**
- * @dataProvider providerCreateFromColumnRowArray
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromColumnRowArray')]
public function testCreateFromColumnRowArray(
int $columnId,
int $rowId,
@@ -129,9 +119,7 @@ class CellAddressTest extends TestCase
];
}
- /**
- * @dataProvider providerCreateFromColumnRowException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromColumnRowException')]
public function testCreateFromColumnRowArrayException(mixed $columnId, mixed $rowId): void
{
$this->expectException(Exception::class);
@@ -149,9 +137,7 @@ class CellAddressTest extends TestCase
];
}
- /**
- * @dataProvider providerCreateFromCellAddressWithWorksheet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateFromCellAddressWithWorksheet')]
public function testCreateFromCellAddressWithWorksheet(
string $cellAddress,
string $expectedCellAddress,
diff --git a/tests/PhpSpreadsheetTests/Cell/CellDetachTest.php b/tests/PhpSpreadsheetTests/Cell/CellDetachTest.php
index faec5dbd9..db8bea661 100644
--- a/tests/PhpSpreadsheetTests/Cell/CellDetachTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/CellDetachTest.php
@@ -21,9 +21,7 @@ class CellDetachTest extends TestCase
}
}
- /**
- * @dataProvider providerMethodName
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMethodName')]
public function testDetach(string $method): void
{
$this->expectException(SpreadsheetException::class);
@@ -51,9 +49,7 @@ class CellDetachTest extends TestCase
];
}
- /**
- * @dataProvider providerMethodNameSet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMethodNameSet')]
public function testDetachSet(string $method): void
{
$this->expectException(SpreadsheetException::class);
diff --git a/tests/PhpSpreadsheetTests/Cell/CellTest.php b/tests/PhpSpreadsheetTests/Cell/CellTest.php
index 0a4308b61..f3539c607 100644
--- a/tests/PhpSpreadsheetTests/Cell/CellTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/CellTest.php
@@ -76,9 +76,7 @@ class CellTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerSetValueExplicit
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetValueExplicit')]
public function testSetValueExplicit(mixed $expected, mixed $value, string $dataType): void
{
$spreadsheet = new Spreadsheet();
@@ -105,9 +103,7 @@ class CellTest extends TestCase
$cell->setValueExplicit($dateValue, DataType::TYPE_ISO_DATE);
}
- /**
- * @dataProvider providerSetValueExplicitException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSetValueExplicitException')]
public function testSetValueExplicitException(mixed $value, string $dataType): void
{
$this->expectException(Exception::class);
@@ -250,9 +246,7 @@ class CellTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider appliedStyling
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('appliedStyling')]
public function testAppliedStyleSingleCell(string $cellAddress, string $fillStyle, ?string $fillColor): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php b/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php
index d15592830..35a7fbb82 100644
--- a/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/CoordinateTest.php
@@ -11,9 +11,7 @@ use TypeError;
class CoordinateTest extends TestCase
{
- /**
- * @dataProvider providerColumnString
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColumnString')]
public function testColumnIndexFromString(mixed $expectedResult, string $string): void
{
$columnIndex = Coordinate::columnIndexFromString($string);
@@ -58,9 +56,7 @@ class CoordinateTest extends TestCase
self::fail('An expected exception has not been raised.');
}
- /**
- * @dataProvider providerColumnIndex
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColumnIndex')]
public function testStringFromColumnIndex(mixed $expectedResult, int $columnIndex): void
{
$string = Coordinate::stringFromColumnIndex($columnIndex);
@@ -75,9 +71,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/ColumnIndex.php';
}
- /**
- * @dataProvider providerCoordinates
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCoordinates')]
public function testCoordinateFromString(mixed $expectedResult, string $rangeSet): void
{
$result = Coordinate::coordinateFromString($rangeSet);
@@ -89,9 +83,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellCoordinates.php';
}
- /**
- * @dataProvider providerIndexesFromString
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIndexesFromString')]
public function testIndexesFromString(array $expectedResult, string $rangeSet): void
{
$result = Coordinate::indexesFromString($rangeSet);
@@ -148,9 +140,7 @@ class CoordinateTest extends TestCase
self::fail('An expected exception has not been raised.');
}
- /**
- * @dataProvider providerAbsoluteCoordinates
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAbsoluteCoordinates')]
public function testAbsoluteCoordinateFromString(string $expectedResult, string $rangeSet): void
{
$result = Coordinate::absoluteCoordinate($rangeSet);
@@ -177,9 +167,7 @@ class CoordinateTest extends TestCase
self::fail('An expected exception has not been raised.');
}
- /**
- * @dataProvider providerAbsoluteReferences
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAbsoluteReferences')]
public function testAbsoluteReferenceFromString(mixed $expectedResult, int|string $rangeSet): void
{
$result = Coordinate::absoluteReference((string) $rangeSet);
@@ -206,9 +194,7 @@ class CoordinateTest extends TestCase
self::fail('An expected exception has not been raised.');
}
- /**
- * @dataProvider providerSplitRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSplitRange')]
public function testSplitRange(array $expectedResult, string $rangeSet): void
{
$result = Coordinate::splitRange($rangeSet);
@@ -226,9 +212,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellSplitRange.php';
}
- /**
- * @dataProvider providerBuildRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBuildRange')]
public function testBuildRange(mixed $expectedResult, array $rangeSets): void
{
$result = Coordinate::buildRange($rangeSets);
@@ -258,9 +242,7 @@ class CoordinateTest extends TestCase
Coordinate::buildRange($cellRange);
}
- /**
- * @dataProvider providerRangeBoundaries
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRangeBoundaries')]
public function testRangeBoundaries(mixed $expectedResult, string $rangeSet): void
{
$result = Coordinate::rangeBoundaries($rangeSet);
@@ -272,9 +254,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellRangeBoundaries.php';
}
- /**
- * @dataProvider providerRangeDimension
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRangeDimension')]
public function testRangeDimension(mixed $expectedResult, string $rangeSet): void
{
$result = Coordinate::rangeDimension($rangeSet);
@@ -286,9 +266,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellRangeDimension.php';
}
- /**
- * @dataProvider providerGetRangeBoundaries
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGetRangeBoundaries')]
public function testGetRangeBoundaries(mixed $expectedResult, string $rangeSet): void
{
$result = Coordinate::getRangeBoundaries($rangeSet);
@@ -300,9 +278,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellGetRangeBoundaries.php';
}
- /**
- * @dataProvider providerCoordinateIsInsideRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCoordinateIsInsideRange')]
public static function testCoordinateIsInsideRange(bool $expectedResult, string $range, string $coordinate): void
{
$result = Coordinate::coordinateIsInsideRange($range, $coordinate);
@@ -314,9 +290,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/Cell/CoordinateIsInsideRange.php';
}
- /**
- * @dataProvider providerCoordinateIsInsideRangeException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCoordinateIsInsideRangeException')]
public static function testCoordinateIsInsideRangeException(string $expectedResult, string $range, string $coordinate): void
{
try {
@@ -335,9 +309,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/Cell/CoordinateIsInsideRangeException.php';
}
- /**
- * @dataProvider providerExtractAllCellReferencesInRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExtractAllCellReferencesInRange')]
public function testExtractAllCellReferencesInRange(array $expectedResult, string $rangeSet): void
{
$result = Coordinate::extractAllCellReferencesInRange($rangeSet);
@@ -349,9 +321,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellExtractAllCellReferencesInRange.php';
}
- /**
- * @dataProvider providerInvalidRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInvalidRange')]
public function testExtractAllCellReferencesInRangeInvalidRange(string $range): void
{
$this->expectException(Exception::class);
@@ -365,9 +335,7 @@ class CoordinateTest extends TestCase
return [['Z1:A1'], ['A4:A1'], ['B1:A1'], ['AA1:Z1']];
}
- /**
- * @dataProvider providerMergeRangesInCollection
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMergeRangesInCollection')]
public function testMergeRangesInCollection(mixed $expectedResult, array $rangeSets): void
{
$result = Coordinate::mergeRangesInCollection($rangeSets);
@@ -379,9 +347,7 @@ class CoordinateTest extends TestCase
return require 'tests/data/CellMergeRangesInCollection.php';
}
- /**
- * @dataProvider providerCoordinateIsRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCoordinateIsRange')]
public function testCoordinateIsRange(mixed $expectedResult, string $rangeSet): void
{
$result = Coordinate::coordinateIsRange($rangeSet);
diff --git a/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php
index 8cb5d8876..cbb6eaf81 100644
--- a/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/DefaultValueBinderTest.php
@@ -15,9 +15,7 @@ use PHPUnit\Framework\TestCase;
class DefaultValueBinderTest extends TestCase
{
- /**
- * @dataProvider binderProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('binderProvider')]
public function testBindValue(null|string|bool|int|float|DateTime|DateTimeImmutable $value): void
{
$spreadsheet = new Spreadsheet();
@@ -72,9 +70,7 @@ class DefaultValueBinderTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerDataTypeForValue
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataTypeForValue')]
public function testDataTypeForValue(mixed $expectedResult, mixed $value): void
{
$result = DefaultValueBinder::dataTypeForValue($value);
diff --git a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php
index 71006fff8..ecd3b4a53 100644
--- a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php
+++ b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php
@@ -28,9 +28,7 @@ class StringValueBinderTest extends TestCase
Cell::setValueBinder($this->valueBinder);
}
- /**
- * @dataProvider providerDataValuesDefault
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesDefault')]
public function testStringValueBinderDefaultBehaviour(
mixed $value,
mixed $expectedValue,
@@ -98,9 +96,7 @@ class StringValueBinderTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerDataValuesSuppressNullConversion
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesSuppressNullConversion')]
public function testStringValueBinderSuppressNullConversion(
mixed $value,
mixed $expectedValue,
@@ -127,9 +123,7 @@ class StringValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider providerDataValuesSuppressBooleanConversion
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesSuppressBooleanConversion')]
public function testStringValueBinderSuppressBooleanConversion(
mixed $value,
mixed $expectedValue,
@@ -157,9 +151,7 @@ class StringValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider providerDataValuesSuppressNumericConversion
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesSuppressNumericConversion')]
public function testStringValueBinderSuppressNumericConversion(
mixed $value,
mixed $expectedValue,
@@ -194,9 +186,7 @@ class StringValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider providerDataValuesSuppressFormulaConversion
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesSuppressFormulaConversion')]
public function testStringValueBinderSuppressFormulaConversion(
mixed $value,
mixed $expectedValue,
@@ -227,9 +217,7 @@ class StringValueBinderTest extends TestCase
];
}
- /**
- * @dataProvider providerDataValuesSuppressAllConversion
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataValuesSuppressAllConversion')]
public function testStringValueBinderSuppressAllConversion(
mixed $value,
mixed $expectedValue,
diff --git a/tests/PhpSpreadsheetTests/CellReferenceHelperTest.php b/tests/PhpSpreadsheetTests/CellReferenceHelperTest.php
index 572ffbff0..d555de423 100644
--- a/tests/PhpSpreadsheetTests/CellReferenceHelperTest.php
+++ b/tests/PhpSpreadsheetTests/CellReferenceHelperTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class CellReferenceHelperTest extends TestCase
{
- /**
- * @dataProvider cellReferenceHelperInsertColumnsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperInsertColumnsProvider')]
public function testCellReferenceHelperInsertColumns(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 2, 0);
@@ -56,9 +54,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperDeleteColumnsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperDeleteColumnsProvider')]
public function testCellReferenceHelperDeleteColumns(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', -2, 0);
@@ -92,9 +88,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperInsertRowsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperInsertRowsProvider')]
public function testCellReferenceHelperInsertRows(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 0, 2);
@@ -124,9 +118,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperDeleteRowsProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperDeleteRowsProvider')]
public function testCellReferenceHelperDeleteRows(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 0, -2);
@@ -152,9 +144,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperInsertColumnsAbsoluteProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperInsertColumnsAbsoluteProvider')]
public function testCellReferenceHelperInsertColumnsAbsolute(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 2, 0);
@@ -180,9 +170,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperDeleteColumnsAbsoluteProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperDeleteColumnsAbsoluteProvider')]
public function testCellReferenceHelperDeleteColumnsAbsolute(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', -2, 0);
@@ -208,9 +196,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperInsertRowsAbsoluteProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperInsertRowsAbsoluteProvider')]
public function testCellReferenceHelperInsertRowsAbsolute(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 0, 2);
@@ -236,9 +222,7 @@ class CellReferenceHelperTest extends TestCase
];
}
- /**
- * @dataProvider cellReferenceHelperDeleteRowsAbsoluteProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellReferenceHelperDeleteRowsAbsoluteProvider')]
public function testCellReferenceHelperDeleteRowsAbsolute(string $expectedResult, string $cellAddress): void
{
$cellReferenceHelper = new CellReferenceHelper('E5', 0, -2);
diff --git a/tests/PhpSpreadsheetTests/Chart/Charts32CatAxValAxTest.php b/tests/PhpSpreadsheetTests/Chart/Charts32CatAxValAxTest.php
index 0937345cd..cbc235e76 100644
--- a/tests/PhpSpreadsheetTests/Chart/Charts32CatAxValAxTest.php
+++ b/tests/PhpSpreadsheetTests/Chart/Charts32CatAxValAxTest.php
@@ -34,9 +34,7 @@ class Charts32CatAxValAxTest extends TestCase
}
}
- /**
- * @dataProvider providerCatAxValAx
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCatAxValAx')]
public function test1CatAx1ValAx(?bool $numeric): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Chart/Charts32XmlTest.php b/tests/PhpSpreadsheetTests/Chart/Charts32XmlTest.php
index d6b6564a0..282c9588b 100644
--- a/tests/PhpSpreadsheetTests/Chart/Charts32XmlTest.php
+++ b/tests/PhpSpreadsheetTests/Chart/Charts32XmlTest.php
@@ -14,9 +14,7 @@ class Charts32XmlTest extends TestCase
// These tests can only be performed by examining xml.
private const DIRECTORY = 'samples' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
- /**
- * @dataProvider providerScatterCharts
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerScatterCharts')]
public function testBezierCount(int $expectedCount, string $inputFile): void
{
$file = self::DIRECTORY . $inputFile;
@@ -71,9 +69,7 @@ class Charts32XmlTest extends TestCase
self::assertSame(0, substr_count($data, ''));
}
- /**
- * @dataProvider providerCatAxValAx
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCatAxValAx')]
public function testCatAxValAx(?bool $numeric): void
{
$file = self::DIRECTORY . '32readwriteScatterChart1.xlsx';
diff --git a/tests/PhpSpreadsheetTests/Chart/Issue562Test.php b/tests/PhpSpreadsheetTests/Chart/Issue562Test.php
index 21bb903fa..ce9d6c5c5 100644
--- a/tests/PhpSpreadsheetTests/Chart/Issue562Test.php
+++ b/tests/PhpSpreadsheetTests/Chart/Issue562Test.php
@@ -29,9 +29,7 @@ class Issue562Test extends AbstractFunctional
$writer->setIncludeCharts(true);
}
- /**
- * @dataProvider providerNoBorder
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNoBorder')]
public function testNoBorder(?bool $noBorder, bool $expectedResult): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/DefinedNameFormulaTest.php b/tests/PhpSpreadsheetTests/DefinedNameFormulaTest.php
index 131163def..4117c4745 100644
--- a/tests/PhpSpreadsheetTests/DefinedNameFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/DefinedNameFormulaTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class DefinedNameFormulaTest extends TestCase
{
- /**
- * @dataProvider providerRangeOrFormula
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRangeOrFormula')]
public function testRangeOrFormula(string $value, bool $expectedResult): void
{
$actualResult = DefinedName::testIfFormula($value);
diff --git a/tests/PhpSpreadsheetTests/Document/EpochTest.php b/tests/PhpSpreadsheetTests/Document/EpochTest.php
index feb98c8af..9947b2918 100644
--- a/tests/PhpSpreadsheetTests/Document/EpochTest.php
+++ b/tests/PhpSpreadsheetTests/Document/EpochTest.php
@@ -25,9 +25,7 @@ class EpochTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testSetCreated(string $format, string $timestamp): void
{
$spreadsheet = new Spreadsheet();
@@ -77,9 +75,7 @@ class EpochTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats2
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats2')]
public function testConsistentTimeStamp(string $format): void
{
$pgmstart = (float) (new DateTime())->format('U');
diff --git a/tests/PhpSpreadsheetTests/Document/PropertiesTest.php b/tests/PhpSpreadsheetTests/Document/PropertiesTest.php
index 7d491d25e..1b32aeaec 100644
--- a/tests/PhpSpreadsheetTests/Document/PropertiesTest.php
+++ b/tests/PhpSpreadsheetTests/Document/PropertiesTest.php
@@ -44,9 +44,7 @@ class PropertiesTest extends TestCase
self::assertSame($creator, $this->properties->getCreator());
}
- /**
- * @dataProvider providerCreationTime
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreationTime')]
public function testSetCreated(null|int $expectedCreationTime, null|int|string $created): void
{
$expectedCreationTime = $expectedCreationTime ?? $this->startTime;
@@ -73,9 +71,7 @@ class PropertiesTest extends TestCase
self::assertSame($creator, $this->properties->getLastModifiedBy());
}
- /**
- * @dataProvider providerModifiedTime
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerModifiedTime')]
public function testSetModified(mixed $expectedModifiedTime, null|int|string $modified): void
{
$expectedModifiedTime = $expectedModifiedTime ?? $this->startTime;
@@ -150,9 +146,7 @@ class PropertiesTest extends TestCase
self::assertSame($manager, $this->properties->getManager());
}
- /**
- * @dataProvider providerCustomProperties
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCustomProperties')]
public function testSetCustomProperties(mixed $expectedType, mixed $expectedValue, string $propertyName, null|bool|float|int|string $propertyValue, ?string $propertyType = null): void
{
if ($propertyType === null) {
diff --git a/tests/PhpSpreadsheetTests/Document/SecurityTest.php b/tests/PhpSpreadsheetTests/Document/SecurityTest.php
index 015e32ba2..75cf5106f 100644
--- a/tests/PhpSpreadsheetTests/Document/SecurityTest.php
+++ b/tests/PhpSpreadsheetTests/Document/SecurityTest.php
@@ -54,9 +54,7 @@ class SecurityTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerLocks
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLocks')]
public function testLocks(bool $revision, bool $windows, bool $structure): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php
index a14e2c5ac..1ce621f74 100644
--- a/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php
+++ b/tests/PhpSpreadsheetTests/DocumentGeneratorTest.php
@@ -18,18 +18,14 @@ class DocumentGeneratorTest extends TestCase
private static bool $succeededByCategory = false;
- /**
- * @dataProvider providerGenerateFunctionListByName
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGenerateFunctionListByName')]
public function testGenerateFunctionListByName(array $phpSpreadsheetFunctions, string $expected): void
{
self::assertEquals($expected, DocumentGenerator::generateFunctionListByName($phpSpreadsheetFunctions));
self::$succeededByName = true;
}
- /**
- * @dataProvider providerGenerateFunctionListByCategory
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGenerateFunctionListByCategory')]
public function testGenerateFunctionListByCategory(array $phpSpreadsheetFunctions, string $expected): void
{
self::assertEquals($expected, DocumentGenerator::generateFunctionListByCategory($phpSpreadsheetFunctions));
diff --git a/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php
index a6e1b33ff..c6a2d43d2 100644
--- a/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/ActiveSheetTest.php
@@ -18,9 +18,8 @@ class ActiveSheetTest extends AbstractFunctional
/**
* Test load file with correct active sheet.
- *
- * @dataProvider providerFormats
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testActiveSheet(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/ColumnWidthTest.php b/tests/PhpSpreadsheetTests/Functional/ColumnWidthTest.php
index fa6e958f2..0f7e5f7e4 100644
--- a/tests/PhpSpreadsheetTests/Functional/ColumnWidthTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/ColumnWidthTest.php
@@ -16,9 +16,7 @@ class ColumnWidthTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testReadColumnWidth(string $format): void
{
// create new sheet with column width
diff --git a/tests/PhpSpreadsheetTests/Functional/CommentsTest.php b/tests/PhpSpreadsheetTests/Functional/CommentsTest.php
index 36ec29b97..c92f1c4e1 100644
--- a/tests/PhpSpreadsheetTests/Functional/CommentsTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/CommentsTest.php
@@ -21,9 +21,8 @@ class CommentsTest extends AbstractFunctional
/**
* Test load file with comment in sheet to load proper
* count of comments in correct coords.
- *
- * @dataProvider providerFormats
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testComments(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/ConditionalStopIfTrueTest.php b/tests/PhpSpreadsheetTests/Functional/ConditionalStopIfTrueTest.php
index b886c9e06..7c091c2f7 100644
--- a/tests/PhpSpreadsheetTests/Functional/ConditionalStopIfTrueTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/ConditionalStopIfTrueTest.php
@@ -18,9 +18,7 @@ class ConditionalStopIfTrueTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testConditionalStopIfTrue(string $format): void
{
$pCoordinate = 'A1:A3';
diff --git a/tests/PhpSpreadsheetTests/Functional/EnclosureTest.php b/tests/PhpSpreadsheetTests/Functional/EnclosureTest.php
index c1b767192..bf58132af 100644
--- a/tests/PhpSpreadsheetTests/Functional/EnclosureTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/EnclosureTest.php
@@ -19,9 +19,7 @@ class EnclosureTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testEnclosure(string $format): void
{
$value = '
';
diff --git a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php
index 28b05b2d7..88dd4606b 100644
--- a/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/FreezePaneTest.php
@@ -19,9 +19,7 @@ class FreezePaneTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testFreezePane(string $format): void
{
$cellSplit = 'B4';
@@ -43,9 +41,7 @@ class FreezePaneTest extends AbstractFunctional
$reloadedSpreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testFreezePaneWithInvalidSelectedCells(string $format): void
{
$cellSplit = 'A7';
@@ -71,9 +67,7 @@ class FreezePaneTest extends AbstractFunctional
$reloadedSpreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testFreezePaneUserSelectedCell(string $format): void
{
$spreadsheet = new Spreadsheet();
@@ -115,9 +109,7 @@ class FreezePaneTest extends AbstractFunctional
$reloadedSpreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testNoFreezePaneUserSelectedCell(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/MergedCellsTest.php b/tests/PhpSpreadsheetTests/Functional/MergedCellsTest.php
index c99826bfd..b6e8b10bf 100644
--- a/tests/PhpSpreadsheetTests/Functional/MergedCellsTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/MergedCellsTest.php
@@ -18,9 +18,7 @@ class MergedCellsTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testMergedCells(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php b/tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php
index 535f927fe..2918341eb 100644
--- a/tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/PrintAreaTest.php
@@ -17,9 +17,7 @@ class PrintAreaTest extends AbstractFunctional
];
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testPageSetup(string $format): void
{
// Create new workbook with 6 sheets and different print areas
diff --git a/tests/PhpSpreadsheetTests/Functional/ReadBlankCellsTest.php b/tests/PhpSpreadsheetTests/Functional/ReadBlankCellsTest.php
index be00dd392..b44c43f31 100644
--- a/tests/PhpSpreadsheetTests/Functional/ReadBlankCellsTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/ReadBlankCellsTest.php
@@ -50,9 +50,8 @@ class ReadBlankCellsTest extends AbstractFunctional
/**
* Test generate file with some empty cells.
- *
- * @dataProvider providerSheetFormat
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSheetFormat')]
public function testLoadAndSaveReadEmpty(string $format, bool $expected): void
{
$filename = 'tests/data/Reader/XLSX/blankcell.xlsx';
@@ -72,9 +71,8 @@ class ReadBlankCellsTest extends AbstractFunctional
/**
* Test generate file with some empty cells.
- *
- * @dataProvider providerSheetFormat
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSheetFormat')]
public function testLoadAndSaveDontReadEmpty(string $format): void
{
$filename = 'tests/data/Reader/XLSX/blankcell.xlsx';
diff --git a/tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php b/tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php
index 7b352dde2..9b4920d84 100644
--- a/tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/ReadFilterTest.php
@@ -33,9 +33,8 @@ class ReadFilterTest extends AbstractFunctional
/**
* Test load Xlsx file with many empty cells with no filter used.
- *
- * @dataProvider providerCellsValues
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCellsValues')]
public function testXlsxLoadWithoutReadFilter(string $format, array $arrayData): void
{
$spreadsheet = new Spreadsheet();
@@ -58,9 +57,8 @@ class ReadFilterTest extends AbstractFunctional
/**
* Test load Xlsx file with many empty cells (and big max row number) with readfilter.
- *
- * @dataProvider providerCellsValues
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCellsValues')]
public function testXlsxLoadWithReadFilter(string $format, array $arrayData): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php
index 89a7327e5..90f806b02 100644
--- a/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/SelectedCellsTest.php
@@ -17,9 +17,8 @@ class SelectedCellsTest extends AbstractFunctional
/**
* Test load file with correct selected cells.
- *
- * @dataProvider providerFormats
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testSelectedCells(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/StreamTest.php b/tests/PhpSpreadsheetTests/Functional/StreamTest.php
index 3430b7a31..9d062d2b8 100644
--- a/tests/PhpSpreadsheetTests/Functional/StreamTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/StreamTest.php
@@ -26,9 +26,7 @@ class StreamTest extends TestCase
return $providerFormats;
}
- /**
- * @dataProvider providerFormats
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testAllWritersCanWriteToStream(string $format): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/TypeAttributePreservationTest.php b/tests/PhpSpreadsheetTests/Functional/TypeAttributePreservationTest.php
index e90cf4267..20aecf94b 100644
--- a/tests/PhpSpreadsheetTests/Functional/TypeAttributePreservationTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/TypeAttributePreservationTest.php
@@ -31,9 +31,8 @@ class TypeAttributePreservationTest extends AbstractFunctional
/**
* Ensure saved spreadsheets maintain the correct data type.
- *
- * @dataProvider providerFormulae
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormulae')]
public function testFormulae(string $format, array $values): void
{
$spreadsheet = new Spreadsheet();
@@ -63,9 +62,8 @@ class TypeAttributePreservationTest extends AbstractFunctional
/**
* Ensure saved spreadsheets maintain the correct data type.
- *
- * @dataProvider providerFormulae
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormulae')]
public function testFormulaeNoPrecalc(string $format, array $values): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Functional/WorkbookViewAttributesTest.php b/tests/PhpSpreadsheetTests/Functional/WorkbookViewAttributesTest.php
index 5c21443a9..fee6dbbe8 100644
--- a/tests/PhpSpreadsheetTests/Functional/WorkbookViewAttributesTest.php
+++ b/tests/PhpSpreadsheetTests/Functional/WorkbookViewAttributesTest.php
@@ -21,9 +21,8 @@ class WorkbookViewAttributesTest extends AbstractFunctional
* are preserved when xlsx documents are read and written.
*
* @see https://github.com/PHPOffice/PhpSpreadsheet/issues/523
- *
- * @dataProvider providerFormats
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormats')]
public function testPreserveWorkbookViewAttributes(string $format): void
{
// Create a dummy workbook with two worksheets
diff --git a/tests/PhpSpreadsheetTests/Helper/DimensionTest.php b/tests/PhpSpreadsheetTests/Helper/DimensionTest.php
index e6a823c76..46ea88a16 100644
--- a/tests/PhpSpreadsheetTests/Helper/DimensionTest.php
+++ b/tests/PhpSpreadsheetTests/Helper/DimensionTest.php
@@ -10,18 +10,14 @@ use PHPUnit\Framework\TestCase;
class DimensionTest extends TestCase
{
- /**
- * @dataProvider providerCellWidth
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCellWidth')]
public function testCreateDimension(float $expectedResult, string $dimension): void
{
$result = (new Dimension($dimension))->width();
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerConvertUoM
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerConvertUoM')]
public function testConvertDimension(float $expectedResult, string $dimension, string $unitOfMeasure): void
{
$result = (new Dimension($dimension))->toUnit($unitOfMeasure);
diff --git a/tests/PhpSpreadsheetTests/Helper/HtmlTest.php b/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
index 26f22847a..6779fb9b5 100644
--- a/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
+++ b/tests/PhpSpreadsheetTests/Helper/HtmlTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class HtmlTest extends TestCase
{
- /**
- * @dataProvider providerUtf8EncodingSupport
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerUtf8EncodingSupport')]
public function testUtf8EncodingSupport(string $expected, string $input): void
{
$html = new Html();
diff --git a/tests/PhpSpreadsheetTests/Helper/SampleCoverageTest.php b/tests/PhpSpreadsheetTests/Helper/SampleCoverageTest.php
index 2c54dd68f..52fe5c0da 100644
--- a/tests/PhpSpreadsheetTests/Helper/SampleCoverageTest.php
+++ b/tests/PhpSpreadsheetTests/Helper/SampleCoverageTest.php
@@ -8,9 +8,7 @@ use PhpOffice\PhpSpreadsheet\Helper\Sample;
use PHPUnit\Framework\TestCase;
use RuntimeException;
-/**
- * @covers \PhpOffice\PhpSpreadsheet\Helper\Sample
- */
+#[\PHPUnit\Framework\Attributes\CoversClass(Sample::class)]
class SampleCoverageTest extends TestCase
{
public function testSample(): void
diff --git a/tests/PhpSpreadsheetTests/Helper/SampleTest.php b/tests/PhpSpreadsheetTests/Helper/SampleTest.php
index f20c2163c..e8c79bed4 100644
--- a/tests/PhpSpreadsheetTests/Helper/SampleTest.php
+++ b/tests/PhpSpreadsheetTests/Helper/SampleTest.php
@@ -9,13 +9,9 @@ use PHPUnit\Framework\TestCase;
class SampleTest extends TestCase
{
- /**
- * @runInSeparateProcess
- *
- * @preserveGlobalState disabled
- *
- * @dataProvider providerSample
- */
+ #[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
+ #[\PHPUnit\Framework\Attributes\PreserveGlobalState(false)]
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerSample')]
public function testSample(string $sample): void
{
ob_start();
diff --git a/tests/PhpSpreadsheetTests/IOFactoryTest.php b/tests/PhpSpreadsheetTests/IOFactoryTest.php
index 90628fbee..86244e7de 100644
--- a/tests/PhpSpreadsheetTests/IOFactoryTest.php
+++ b/tests/PhpSpreadsheetTests/IOFactoryTest.php
@@ -13,9 +13,7 @@ use PHPUnit\Framework\TestCase;
class IOFactoryTest extends TestCase
{
- /**
- * @dataProvider providerCreateWriter
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateWriter')]
public function testCreateWriter(string $name, string $expected): void
{
$spreadsheet = new Spreadsheet();
@@ -45,9 +43,7 @@ class IOFactoryTest extends TestCase
self::assertInstanceOf(Writer\Pdf\Mpdf::class, $actual);
}
- /**
- * @dataProvider providerCreateReader
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCreateReader')]
public function testCreateReader(string $name, string $expected): void
{
$actual = IOFactory::createReader($name);
@@ -75,9 +71,7 @@ class IOFactoryTest extends TestCase
self::assertInstanceOf(Reader\Html::class, $actual);
}
- /**
- * @dataProvider providerIdentify
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIdentify')]
public function testIdentifyCreateLoad(string $file, string $expectedName, string $expectedClass): void
{
$actual = IOFactory::identify($file);
diff --git a/tests/PhpSpreadsheetTests/NamedRange2Test.php b/tests/PhpSpreadsheetTests/NamedRange2Test.php
index 9061d6e1e..04b3e0031 100644
--- a/tests/PhpSpreadsheetTests/NamedRange2Test.php
+++ b/tests/PhpSpreadsheetTests/NamedRange2Test.php
@@ -90,9 +90,7 @@ class NamedRange2Test extends TestCase
self::assertSame('lightDown', $sheet->getStyle('E3')->getFill()->getFillType());
}
- /**
- * @dataProvider providerRangeOrFormula
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRangeOrFormula')]
public function testNamedRangeSetStyleBad(string $exceptionMessage, string $name): void
{
$this->expectException(Except::class);
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvEncodingTest.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvEncodingTest.php
index 7ce3c5f4f..3e4ce79ab 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvEncodingTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvEncodingTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class CsvEncodingTest extends TestCase
{
- /**
- * @dataProvider providerEncodings
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEncodings')]
public function testEncodings(string $filename, string $encoding): void
{
$reader = new Csv();
@@ -21,9 +19,7 @@ class CsvEncodingTest extends TestCase
self::assertEquals('Å', $sheet->getCell('A1')->getValue());
}
- /**
- * @dataProvider providerEncodings
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEncodings')]
public function testWorkSheetInfo(string $filename, string $encoding): void
{
$reader = new Csv();
@@ -51,9 +47,7 @@ class CsvEncodingTest extends TestCase
];
}
- /**
- * @dataProvider providerGuessEncoding
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGuessEncoding')]
public function testGuessEncoding(string $filename): void
{
$reader = new Csv();
@@ -86,9 +80,7 @@ class CsvEncodingTest extends TestCase
self::assertEquals('�', $sheet->getCell('C3')->getValue());
}
- /**
- * @dataProvider providerGuessEncoding
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerGuessEncoding')]
public function testFallbackEncoding(string $filename): void
{
$reader = new Csv();
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvIssue2232Test.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvIssue2232Test.php
index 191aa9d84..05f69fb4b 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvIssue2232Test.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvIssue2232Test.php
@@ -29,9 +29,7 @@ class CsvIssue2232Test extends TestCase
Settings::setLocale($this->locale);
}
- /**
- * @dataProvider providerIssue2232
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIssue2232')]
public function testBooleanConversions(bool $useStringBinder, ?bool $preserveBoolString, bool|string $b2Value, bool|string $b3Value): void
{
if ($useStringBinder) {
@@ -62,9 +60,7 @@ class CsvIssue2232Test extends TestCase
];
}
- /**
- * @dataProvider providerIssue2232locale
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIssue2232locale')]
public function testBooleanConversionsLocaleAware(bool $useStringBinder, ?bool $preserveBoolString, mixed $b2Value, mixed $b3Value, mixed $b4Value, mixed $b5Value): void
{
if ($useStringBinder) {
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvLineEndingTest.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvLineEndingTest.php
index 28ff9f30f..3fc1d3031 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvLineEndingTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvLineEndingTest.php
@@ -12,6 +12,8 @@ class CsvLineEndingTest extends TestCase
{
private string $tempFile = '';
+ private static bool $alwaysFalse = false;
+
protected function tearDown(): void
{
if ($this->tempFile !== '') {
@@ -20,9 +22,7 @@ class CsvLineEndingTest extends TestCase
}
}
- /**
- * @dataProvider providerEndings
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEndings')]
public function testEndings(string $ending): void
{
if ($ending === "\r" && PHP_VERSION_ID >= 90000) {
@@ -32,6 +32,9 @@ class CsvLineEndingTest extends TestCase
$data = ['123', '456', '789'];
file_put_contents($filename, implode($ending, $data));
$reader = new Csv();
+ if (Csv::DEFAULT_TEST_AUTODETECT === self::$alwaysFalse) {
+ $reader->setTestAutoDetect(true);
+ }
$spreadsheet = $reader->load($filename);
$sheet = $spreadsheet->getActiveSheet();
self::assertEquals($data[0], $sheet->getCell('A1')->getValue());
@@ -40,9 +43,7 @@ class CsvLineEndingTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider providerEndings
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEndings')]
public function testEndingsNoDetect(string $ending): void
{
$this->tempFile = $filename = File::temporaryFilename();
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatLocaleTest.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatLocaleTest.php
index f6bd4e9cb..513576b19 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatLocaleTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatLocaleTest.php
@@ -44,11 +44,8 @@ class CsvNumberFormatLocaleTest extends TestCase
}
}
- /**
- * @dataProvider providerNumberFormatNoConversionTest
- *
- * @runInSeparateProcess
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberFormatNoConversionTest')]
+ #[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
public function testNumberFormatNoConversion(mixed $expectedValue, string $expectedFormat, string $cellAddress): void
{
if (!$this->localeAdjusted) {
@@ -88,11 +85,8 @@ class CsvNumberFormatLocaleTest extends TestCase
];
}
- /**
- * @dataProvider providerNumberValueConversionTest
- *
- * @runInSeparateProcess
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberValueConversionTest')]
+ #[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
public function testNumberValueConversion(mixed $expectedValue, string $cellAddress): void
{
if (!$this->localeAdjusted) {
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatTest.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatTest.php
index 5b3e7a062..d80cfc44e 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvNumberFormatTest.php
@@ -20,9 +20,7 @@ class CsvNumberFormatTest extends TestCase
$this->csvReader = new Csv();
}
- /**
- * @dataProvider providerNumberFormatNoConversionTest
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberFormatNoConversionTest')]
public function testNumberFormatNoConversion(int|string $expectedValue, string $expectedFormat, string $cellAddress): void
{
$spreadsheet = $this->csvReader->load($this->filename);
@@ -55,9 +53,7 @@ class CsvNumberFormatTest extends TestCase
];
}
- /**
- * @dataProvider providerNumberValueConversionTest
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberValueConversionTest')]
public function testNumberValueConversion(mixed $expectedValue, string $cellAddress): void
{
$this->csvReader->castFormattedNumberToNumeric(true);
@@ -104,9 +100,7 @@ class CsvNumberFormatTest extends TestCase
];
}
- /**
- * @dataProvider providerNumberFormatConversionTest
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerNumberFormatConversionTest')]
public function testNumberFormatConversion(mixed $expectedValue, string $expectedFormat, string $cellAddress): void
{
$this->csvReader->castFormattedNumberToNumeric(true, true);
diff --git a/tests/PhpSpreadsheetTests/Reader/Csv/CsvTest.php b/tests/PhpSpreadsheetTests/Reader/Csv/CsvTest.php
index e3da06bcc..a142cb734 100644
--- a/tests/PhpSpreadsheetTests/Reader/Csv/CsvTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Csv/CsvTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class CsvTest extends TestCase
{
- /**
- * @dataProvider providerDelimiterDetection
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDelimiterDetection')]
public function testDelimiterDetection(string $filename, string $expectedDelimiter, string $cell, string|float|int|null $expectedValue): void
{
$reader = new Csv();
@@ -87,9 +85,7 @@ class CsvTest extends TestCase
];
}
- /**
- * @dataProvider providerCanLoad
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCanLoad')]
public function testCanLoad(bool $expected, string $filename): void
{
$reader = new Csv();
@@ -229,9 +225,7 @@ class CsvTest extends TestCase
$reader->load('tests/data/Reader/CSV/encoding.utf8.csvxxx');
}
- /**
- * @dataProvider providerEscapes
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerEscapes')]
public function testInferSeparator(string $escape, string $delimiter): void
{
if (PHP_VERSION_ID >= 90000 && $escape !== '') {
diff --git a/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormula2Test.php b/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormula2Test.php
index 6ea143565..bf45461c8 100644
--- a/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormula2Test.php
+++ b/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormula2Test.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ArrayFormula2Test extends TestCase
{
- /**
- * @dataProvider arrayFormulaReaderProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('arrayFormulaReaderProvider')]
public function testArrayFormulaReader(
string $cellAddress,
string $expectedRange,
diff --git a/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormulaTest.php b/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormulaTest.php
index f0e9599cc..2943ebead 100644
--- a/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Gnumeric/ArrayFormulaTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ArrayFormulaTest extends TestCase
{
- /**
- * @dataProvider arrayFormulaReaderProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('arrayFormulaReaderProvider')]
public function testArrayFormulaReader(
string $cellAddress,
string $expectedRange,
diff --git a/tests/PhpSpreadsheetTests/Reader/Gnumeric/GnumericStylesTest.php b/tests/PhpSpreadsheetTests/Reader/Gnumeric/GnumericStylesTest.php
index e8d332895..dfb046f51 100644
--- a/tests/PhpSpreadsheetTests/Reader/Gnumeric/GnumericStylesTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Gnumeric/GnumericStylesTest.php
@@ -14,9 +14,7 @@ use PHPUnit\Framework\TestCase;
class GnumericStylesTest extends TestCase
{
- /**
- * @dataProvider providerBorderStyle
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBorderStyle')]
public function testBorderStyle(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
@@ -41,9 +39,7 @@ class GnumericStylesTest extends TestCase
}
}
- /**
- * @dataProvider providerfillType
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerfillType')]
public function testFillType(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
@@ -68,9 +64,7 @@ class GnumericStylesTest extends TestCase
}
}
- /**
- * @dataProvider providerHorizontal
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHorizontal')]
public function testHorizontal(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
@@ -95,9 +89,7 @@ class GnumericStylesTest extends TestCase
}
}
- /**
- * @dataProvider providerunderline
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerunderline')]
public function testUnderline(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
@@ -122,9 +114,7 @@ class GnumericStylesTest extends TestCase
}
}
- /**
- * @dataProvider providerVertical
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerVertical')]
public function testVertical(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
@@ -149,9 +139,7 @@ class GnumericStylesTest extends TestCase
}
}
- /**
- * @dataProvider providerDataType
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDataType')]
public function testDataType(string $style, string $expectedResult): void
{
$styles = Gnumeric::gnumericMappings();
diff --git a/tests/PhpSpreadsheetTests/Reader/Gnumeric/PageSetupTest.php b/tests/PhpSpreadsheetTests/Reader/Gnumeric/PageSetupTest.php
index 16a470810..80002f3c7 100644
--- a/tests/PhpSpreadsheetTests/Reader/Gnumeric/PageSetupTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Gnumeric/PageSetupTest.php
@@ -20,9 +20,7 @@ class PageSetupTest extends TestCase
];
}
- /**
- * @dataProvider fileProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('fileProvider')]
public function testPageSetup(string $filename): void
{
$reader = new Gnumeric();
@@ -51,9 +49,7 @@ class PageSetupTest extends TestCase
$spreadsheet->disconnectWorksheets();
}
- /**
- * @dataProvider fileProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('fileProvider')]
public function testPageMargins(string $filename): void
{
$reader = new Gnumeric();
diff --git a/tests/PhpSpreadsheetTests/Reader/Html/HtmlBorderTest.php b/tests/PhpSpreadsheetTests/Reader/Html/HtmlBorderTest.php
index a525b321a..b516de04c 100644
--- a/tests/PhpSpreadsheetTests/Reader/Html/HtmlBorderTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Html/HtmlBorderTest.php
@@ -78,9 +78,7 @@ class HtmlBorderTest extends TestCase
self::assertEquals('333333', $border->getColor()->getRGB());
}
- /**
- * @dataProvider providerBorderStyle
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBorderStyle')]
public function testBorderStyle(string $style, string $expectedResult): void
{
$borders = Html::getBorderMappings();
diff --git a/tests/PhpSpreadsheetTests/Reader/Html/HtmlCharsetTest.php b/tests/PhpSpreadsheetTests/Reader/Html/HtmlCharsetTest.php
index 1daacaf62..f4c0193f2 100644
--- a/tests/PhpSpreadsheetTests/Reader/Html/HtmlCharsetTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Html/HtmlCharsetTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class HtmlCharsetTest extends TestCase
{
- /**
- * @dataProvider providerCharset
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCharset')]
public function testCharset(string $filename, string $expectedResult): void
{
if ($expectedResult === 'exception') {
diff --git a/tests/PhpSpreadsheetTests/Reader/Html/HtmlLibxmlTest.php b/tests/PhpSpreadsheetTests/Reader/Html/HtmlLibxmlTest.php
index bb29eb6c5..5df5c249b 100644
--- a/tests/PhpSpreadsheetTests/Reader/Html/HtmlLibxmlTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Html/HtmlLibxmlTest.php
@@ -14,9 +14,8 @@ use PHPUnit\Framework\TestCase;
* set_error_handler to detect if there has been a problem.
* I want it run in a separate
* process because I am nervous about libxml_use_internal_errors.
- *
- * @runTestsInSeparateProcesses
*/
+#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
class HtmlLibxmlTest extends TestCase
{
private bool $useErrors;
diff --git a/tests/PhpSpreadsheetTests/Reader/Html/HtmlPhpunit10Test.php b/tests/PhpSpreadsheetTests/Reader/Html/HtmlPhpunit10Test.php
index 175f0e8bb..d691a40ce 100644
--- a/tests/PhpSpreadsheetTests/Reader/Html/HtmlPhpunit10Test.php
+++ b/tests/PhpSpreadsheetTests/Reader/Html/HtmlPhpunit10Test.php
@@ -11,9 +11,8 @@ use PHPUnit\Framework\TestCase;
* There were problems running this test in HtmlTest with PhpUnit 10.
* This replacement seem to work. I want it run in a separate
* process because I am nervous about set_error_handler.
- *
- * @runTestsInSeparateProcesses
*/
+#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
class HtmlPhpunit10Test extends TestCase
{
private static string $errorString;
diff --git a/tests/PhpSpreadsheetTests/Reader/Html/HtmlTest.php b/tests/PhpSpreadsheetTests/Reader/Html/HtmlTest.php
index afb01cbfe..8d2341144 100644
--- a/tests/PhpSpreadsheetTests/Reader/Html/HtmlTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Html/HtmlTest.php
@@ -64,9 +64,7 @@ class HtmlTest extends TestCase
];
}
- /**
- * @dataProvider providerCanReadVerySmallFile
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCanReadVerySmallFile')]
public function testCanReadVerySmallFile(bool $expected, string $content): void
{
$filename = HtmlHelper::createHtml($content);
diff --git a/tests/PhpSpreadsheetTests/Reader/Ods/ArrayFormulaTest.php b/tests/PhpSpreadsheetTests/Reader/Ods/ArrayFormulaTest.php
index 726b42ba3..9accf01ae 100644
--- a/tests/PhpSpreadsheetTests/Reader/Ods/ArrayFormulaTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Ods/ArrayFormulaTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ArrayFormulaTest extends TestCase
{
- /**
- * @dataProvider arrayFormulaReaderProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('arrayFormulaReaderProvider')]
public function testArrayFormulaReader(
string $cellAddress,
string $expectedRange,
diff --git a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php
index 9299161f0..fa099ef76 100644
--- a/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Security/XmlScannerTest.php
@@ -13,9 +13,7 @@ use XMLReader;
class XmlScannerTest extends TestCase
{
- /**
- * @dataProvider providerValidXML
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerValidXML')]
public function testValidXML(string $filename, string $expectedResult): void
{
$reader = XmlScanner::getInstance(new \PhpOffice\PhpSpreadsheet\Reader\Xml());
@@ -41,9 +39,7 @@ class XmlScannerTest extends TestCase
return $tests;
}
- /**
- * @dataProvider providerInvalidXML
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInvalidXML')]
public function testInvalidXML(string $filename): void
{
$this->expectException(ReaderException::class);
@@ -94,9 +90,7 @@ class XmlScannerTest extends TestCase
$fileReader->getSecurityScannerOrThrow();
}
- /**
- * @dataProvider providerValidXMLForCallback
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerValidXMLForCallback')]
public function testSecurityScanWithCallback(string $filename, string $expectedResult): void
{
$fileReader = new Xlsx();
@@ -136,9 +130,7 @@ class XmlScannerTest extends TestCase
self::assertSame($input, $output);
}
- /**
- * @dataProvider providerInvalidXlsx
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInvalidXlsx')]
public function testInvalidXlsx(string $filename, string $message): void
{
$this->expectException(ReaderException::class);
@@ -160,9 +152,7 @@ class XmlScannerTest extends TestCase
];
}
- /**
- * @dataProvider providerValidUtf16
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerValidUtf16')]
public function testValidUtf16(string $filename): void
{
$reader = new Xlsx();
diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/ColorMapTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/ColorMapTest.php
index ee571b956..45787c75f 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xls/ColorMapTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xls/ColorMapTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class ColorMapTest extends TestCase
{
- /**
- * @dataProvider colorMapProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('colorMapProvider')]
public function testColorMap(int $index, string $expectedBiff5, string $expectedBiff8, string $expectedBuiltin): void
{
self::assertSame($expectedBiff5, BIFF5::lookup($index)['rgb']);
diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingBasicTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingBasicTest.php
index 684c3d263..ee39c7ce2 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingBasicTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingBasicTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class ConditionalFormattingBasicTest extends TestCase
{
- /**
- * @dataProvider conditionalFormattingProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('conditionalFormattingProvider')]
public function testReadConditionalFormatting(string $expectedRange, array $expectedRules): void
{
$filename = 'tests/data/Reader/XLS/CF_Basic_Comparisons.xls';
diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingExpressionTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingExpressionTest.php
index abdfb9088..eb7a67916 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingExpressionTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xls/ConditionalFormattingExpressionTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class ConditionalFormattingExpressionTest extends TestCase
{
- /**
- * @dataProvider conditionalFormattingProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('conditionalFormattingProvider')]
public function testReadConditionalFormatting(string $expectedRange, array $expectedRule): void
{
$filename = 'tests/data/Reader/XLS/CF_Expression_Comparisons.xls';
diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/DataValidationTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/DataValidationTest.php
index 80619af99..3d30e8ab6 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xls/DataValidationTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xls/DataValidationTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class DataValidationTest extends TestCase
{
- /**
- * @dataProvider dataValidationProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataValidationProvider')]
public function testDataValidation(string $expectedRange, array $expectedRule): void
{
$filename = 'tests/data/Reader/XLS/DataValidation.xls';
diff --git a/tests/PhpSpreadsheetTests/Reader/Xls/ErrorCodeMapTest.php b/tests/PhpSpreadsheetTests/Reader/Xls/ErrorCodeMapTest.php
index c853d5020..170a38a1e 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xls/ErrorCodeMapTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xls/ErrorCodeMapTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ErrorCodeMapTest extends TestCase
{
- /**
- * @dataProvider errorCodeMapProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('errorCodeMapProvider')]
public function testErrorCode(bool|string $expected, int $index): void
{
self::assertSame($expected, ErrorCode::lookup($index));
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php
index f064ec9f3..653a76cd7 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/AutoFilterTest.php
@@ -30,9 +30,7 @@ class AutoFilterTest extends TestCase
];
}
- /**
- * @dataProvider loadDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('loadDataProvider')]
public function testLoad(string $ref, int $expectedReadAutoFilterCalled, string $expectedRef): void
{
$worksheetAutoFilter = $this->getMockBuilder(WorksheetAutoFilter::class)
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/DataValidationTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/DataValidationTest.php
index 3de53c7c7..4935511cb 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/DataValidationTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/DataValidationTest.php
@@ -25,9 +25,8 @@ class DataValidationTest extends TestCase
/**
* Test for load drop down lists of another sheet.
* Pull #2150, issue #2149. Also issue #2677.
- *
- * @dataProvider providerExternalSheet
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExternalSheet')]
public function testDataValidationOfAnotherSheet(string $expectedB14, string $filename): void
{
$reader = new Xlsx();
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/DefaultFillTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/DefaultFillTest.php
index 44fb8e57d..7bdfecdd0 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/DefaultFillTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/DefaultFillTest.php
@@ -40,6 +40,6 @@ class DefaultFillTest extends TestCase
$spreadsheet = $reader->load($filename);
$style = $spreadsheet->getActiveSheet()->getConditionalStyles('A1')[0]->getStyle();
- self::assertSame('solid', $style->getFill()->getFillType());
+ self::assertSame('', $style->getFill()->getFillType());
}
}
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/DirectorySeparatorTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/DirectorySeparatorTest.php
index e90d599a1..c2d8b3152 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/DirectorySeparatorTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/DirectorySeparatorTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class DirectorySeparatorTest extends TestCase
{
- /**
- * @dataProvider providerDirectorySeparator
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDirectorySeparator')]
public function testDirectorySeparatorIdentify(string $fileName): void
{
$filename = "tests/data/Reader/XLSX/{$fileName}";
@@ -21,9 +19,7 @@ class DirectorySeparatorTest extends TestCase
self::assertSame('Xlsx', $reader);
}
- /**
- * @dataProvider providerDirectorySeparator
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDirectorySeparator')]
public function testDirectorySeparatorWorksheetNames(string $fileName): void
{
$filename = "tests/data/Reader/XLSX/{$fileName}";
@@ -34,9 +30,7 @@ class DirectorySeparatorTest extends TestCase
self::assertSame('Sheet', $sheetList[0]);
}
- /**
- * @dataProvider providerDirectorySeparator
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDirectorySeparator')]
public function testDirectorySeparatorWorksheetInfo(string $fileName): void
{
$filename = "tests/data/Reader/XLSX/{$fileName}";
@@ -49,9 +43,7 @@ class DirectorySeparatorTest extends TestCase
self::assertSame(21, (int) $sheetData[0]['totalColumns']);
}
- /**
- * @dataProvider providerDirectorySeparator
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDirectorySeparator')]
public function testDirectorySeparatorLoad(string $fileName): void
{
$filename = "tests/data/Reader/XLSX/{$fileName}";
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/GridlinesTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/GridlinesTest.php
index 5387ea738..1d0003f0c 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/GridlinesTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/GridlinesTest.php
@@ -9,9 +9,7 @@ use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
class GridlinesTest extends AbstractFunctional
{
- /**
- * @dataProvider loadDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('loadDataProvider')]
public function testGridlines(bool $display, bool $print): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/Issue4248Test.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/Issue4248Test.php
new file mode 100644
index 000000000..06b0b7f31
--- /dev/null
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/Issue4248Test.php
@@ -0,0 +1,104 @@
+outfile !== '') {
+ unlink($this->outfile);
+ $this->outfile = '';
+ }
+ }
+
+ public function testStyles(): void
+ {
+ $file = 'tests/data/Reader/XLSX/issue.4248.xlsx';
+ $reader = new XlsxReader();
+ $spreadsheet = $reader->load($file);
+ $writer = new XlsxWriter($spreadsheet);
+ $this->outfile = File::temporaryFilename();
+ $writer->save($this->outfile);
+ $spreadsheet->disconnectWorksheets();
+
+ $file = 'zip://';
+ $file .= $this->outfile;
+ $file .= '#xl/styles.xml';
+ $data = file_get_contents($file) ?: '';
+ $expected = ''
+ . ''
+ . '';
+ self::assertStringContainsString($expected, $data, 'neither fgColor nor bgColor');
+ $expected = ''
+ . ''
+ . ''
+ . '';
+ self::assertStringContainsString($expected, $data, 'bgColor but no fgColor');
+ $expected = ''
+ . '' // dxfId 1 - fill color for Oui
+ . ''
+ . ''
+ . ''
+ . ''
+ . ''
+ . '' // dxfId 2 - fill color for Non
+ . ''
+ . ''
+ . ''
+ . ''
+ . ''
+ . '';
+ self::assertStringContainsString($expected, $data, 'conditional fill styles');
+
+ $file = 'zip://';
+ $file .= $this->outfile;
+ $file .= '#xl/worksheets/sheet1.xml';
+ $data = file_get_contents($file) ?: '';
+ $expected = ''
+ . ''
+ . 'NOT(ISERROR(SEARCH("Oui",C16)))'
+ . ''
+ . '';
+ self::assertStringContainsString($expected, $data, 'first condition for D18');
+ $expected = ''
+ . ''
+ . 'NOT(ISERROR(SEARCH("Non",C16)))'
+ . ''
+ . '';
+ self::assertStringContainsString($expected, $data, 'second condition for D18');
+ }
+
+ public function testHtml(): void
+ {
+ $file = 'tests/data/Reader/XLSX/issue.4248.xlsx';
+ $reader = new XlsxReader();
+ $spreadsheet = $reader->load($file);
+ $writer = new HtmlWriter($spreadsheet);
+
+ $file = 'zip://';
+ $file .= $this->outfile;
+ $file .= '#xl/styles.xml';
+ $data = str_replace(["\r", "\n"], '', $writer->generateHtmlAll());
+ $expected = ' ' // Cell D18
+ . ' | | '
+ . ' | '
+ . ' Eligible | '
+ . ' Non | ';
+ self::assertStringContainsString($expected, $data, 'Cell D18 style');
+ $expected = ' td.style70, th.style70 { vertical-align:middle; text-align:center; border-bottom:1px solid #000000 !important; border-top:2px solid #000000 !important; border-left:2px solid #000000 !important; border-right:1px solid #000000 !important; font-weight:bold; color:#000000; font-family:\'Calibri\'; font-size:16pt; background-color:#BDD7EE }';
+ self::assertStringContainsString($expected, $data, 'background color');
+
+ $spreadsheet->disconnectWorksheets();
+ }
+}
diff --git a/tests/PhpSpreadsheetTests/Reader/Xlsx/XlsxTest.php b/tests/PhpSpreadsheetTests/Reader/Xlsx/XlsxTest.php
index 344f0666a..3b5bbb193 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xlsx/XlsxTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xlsx/XlsxTest.php
@@ -234,9 +234,8 @@ class XlsxTest extends TestCase
/**
* Test if all whitespace is removed from a style definition string.
* This is needed to parse it into properties with the correct keys.
- *
- * @dataProvider providerStripsWhiteSpaceFromStyleString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerStripsWhiteSpaceFromStyleString')]
public function testStripsWhiteSpaceFromStyleString(string $string): void
{
$string = Xlsx::stripWhiteSpaceFromStyleString($string);
diff --git a/tests/PhpSpreadsheetTests/Reader/Xml/XmlStyleCoverageTest.php b/tests/PhpSpreadsheetTests/Reader/Xml/XmlStyleCoverageTest.php
index 73c3d1d53..1aa95cfd1 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xml/XmlStyleCoverageTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xml/XmlStyleCoverageTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class XmlStyleCoverageTest extends TestCase
{
- /**
- * @dataProvider providerBorderStyle
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerBorderStyle')]
public function testBorderStyle(string $style, string $expectedResult): void
{
$styles = Xml::XmlMappings();
@@ -38,9 +36,7 @@ class XmlStyleCoverageTest extends TestCase
}
}
- /**
- * @dataProvider providerfillType
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerfillType')]
public function testFillType(string $style, string $expectedResult): void
{
$styles = Xml::xmlMappings();
diff --git a/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php b/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php
index a308b068d..63ec368df 100644
--- a/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php
+++ b/tests/PhpSpreadsheetTests/Reader/Xml/XmlTest.php
@@ -11,9 +11,7 @@ use PHPUnit\Framework\TestCase;
class XmlTest extends TestCase
{
- /**
- * @dataProvider providerInvalidSimpleXML
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInvalidSimpleXML')]
public function testInvalidSimpleXML(string $filename): void
{
$xmlReader = new Xml();
diff --git a/tests/PhpSpreadsheetTests/RefRangeTest.php b/tests/PhpSpreadsheetTests/RefRangeTest.php
index 17b4e3cd6..7cf3d08e8 100644
--- a/tests/PhpSpreadsheetTests/RefRangeTest.php
+++ b/tests/PhpSpreadsheetTests/RefRangeTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class RefRangeTest extends TestCase
{
- /**
- * @dataProvider providerRefRange
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRefRange')]
public function testRefRange(int|string $expectedResult, string $rangeString): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/ReferenceHelper4Test.php b/tests/PhpSpreadsheetTests/ReferenceHelper4Test.php
index c0dc75611..920acf861 100644
--- a/tests/PhpSpreadsheetTests/ReferenceHelper4Test.php
+++ b/tests/PhpSpreadsheetTests/ReferenceHelper4Test.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ReferenceHelper4Test extends TestCase
{
- /**
- * @dataProvider dataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')]
public function testIssue3907(string $expectedResult, string $settingsTitle, string $formula, string $dataTitle = 'DATA'): void
{
$spreadsheet = new Spreadsheet();
diff --git a/tests/PhpSpreadsheetTests/ReferenceHelper5Test.php b/tests/PhpSpreadsheetTests/ReferenceHelper5Test.php
new file mode 100644
index 000000000..bdb658896
--- /dev/null
+++ b/tests/PhpSpreadsheetTests/ReferenceHelper5Test.php
@@ -0,0 +1,45 @@
+getActiveSheet();
+ $row = 987654;
+ $rowMinus1 = $row - 1;
+ $rowPlus1 = $row + 1;
+ $sheet->getCell("A$rowMinus1")->setValue(1);
+ $sheet->getCell("B$rowMinus1")->setValue(2);
+ $sheet->getCell("C$rowMinus1")->setValue(3);
+ $sheet->getStyle("A$rowMinus1")->getFont()->setBold(true);
+ $sheet->getCell("A$row")->setValue(1);
+ $sheet->getCell("B$row")->setValue(2);
+ $sheet->getCell("C$row")->setValue(3);
+ $sheet->getStyle("B$row")->getFont()->setBold(true);
+
+ $sheet->insertNewRowBefore($row);
+ self::assertTrue(
+ $sheet->getStyle("A$row")->getFont()->getBold()
+ );
+ self::assertFalse(
+ $sheet->getStyle("B$row")->getFont()->getBold()
+ );
+ self::assertFalse(
+ $sheet->getStyle("A$rowPlus1")->getFont()->getBold()
+ );
+ self::assertTrue(
+ $sheet->getStyle("B$rowPlus1")->getFont()->getBold()
+ );
+ $spreadsheet->disconnectWorksheets();
+ }
+}
diff --git a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php
index a28477ca1..a768da97d 100644
--- a/tests/PhpSpreadsheetTests/ReferenceHelperTest.php
+++ b/tests/PhpSpreadsheetTests/ReferenceHelperTest.php
@@ -102,9 +102,7 @@ class ReferenceHelperTest extends TestCase
}
}
- /**
- * @dataProvider providerFormulaUpdates
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFormulaUpdates')]
public function testUpdateFormula(string $formula, int $insertRows, int $insertColumns, string $worksheet, string $expectedResult): void
{
$referenceHelper = ReferenceHelper::getInstance();
@@ -119,9 +117,7 @@ class ReferenceHelperTest extends TestCase
return require 'tests/data/ReferenceHelperFormulaUpdates.php';
}
- /**
- * @dataProvider providerMultipleWorksheetFormulaUpdates
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMultipleWorksheetFormulaUpdates')]
public function testUpdateFormulaForMultipleWorksheets(string $formula, int $insertRows, int $insertColumns, string $expectedResult): void
{
$referenceHelper = ReferenceHelper::getInstance();
diff --git a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php
index e7c021835..448bff3e9 100644
--- a/tests/PhpSpreadsheetTests/Shared/CodePageTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/CodePageTest.php
@@ -11,10 +11,9 @@ use PHPUnit\Framework\TestCase;
class CodePageTest extends TestCase
{
/**
- * @dataProvider providerCodePage
- *
* @param string|string[] $expectedResult
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCodePage')]
public function testCodePageNumberToName(array|string $expectedResult, int $codePageIndex): void
{
if ($expectedResult === 'exception') {
diff --git a/tests/PhpSpreadsheetTests/Shared/Date2Test.php b/tests/PhpSpreadsheetTests/Shared/Date2Test.php
index f5e51728f..c109e0279 100644
--- a/tests/PhpSpreadsheetTests/Shared/Date2Test.php
+++ b/tests/PhpSpreadsheetTests/Shared/Date2Test.php
@@ -37,9 +37,7 @@ class Date2Test extends TestCase
Cell::setCalculateDateTimeType(-1);
}
- /**
- * @dataProvider providerTimeOnly
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerTimeOnly')]
public function testTimeOnly(int|float $expectedResult, int|float|string $value, ?string $format = null): void
{
Cell::setCalculateDateTimeType(Cell::CALCULATE_TIME_FLOAT);
@@ -82,9 +80,7 @@ class Date2Test extends TestCase
];
}
- /**
- * @dataProvider providerDateAndTime
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateAndTime')]
public function testDateAndTime(int|float $expectedResult, int|float|string $value, ?string $format = null): void
{
Cell::setCalculateDateTimeType(Cell::CALCULATE_DATE_TIME_FLOAT);
@@ -127,9 +123,7 @@ class Date2Test extends TestCase
];
}
- /**
- * @dataProvider providerAsis
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsis')]
public function testDefault(int|float $expectedResult, int|float|string $value, ?string $format = null): void
{
//Cell::setCalculateDateTimeType(Cell::CALCULATE_DATE_TIME_ASIS);
@@ -149,9 +143,7 @@ class Date2Test extends TestCase
self::assertSame(1, $this->spreadsheet->getActiveSheetIndex());
}
- /**
- * @dataProvider providerAsis
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerAsis')]
public function testAsis(int|float $expectedResult, int|float|string $value, ?string $format = null): void
{
Cell::setCalculateDateTimeType(Cell::CALCULATE_DATE_TIME_ASIS);
diff --git a/tests/PhpSpreadsheetTests/Shared/DateTest.php b/tests/PhpSpreadsheetTests/Shared/DateTest.php
index c770ac260..e3dbedb6b 100644
--- a/tests/PhpSpreadsheetTests/Shared/DateTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/DateTest.php
@@ -51,9 +51,7 @@ class DateTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerDateTimeExcelToTimestamp1900
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1900')]
public function testDateTimeExcelToTimestamp1900(float|int $expectedResult, float|int $excelDateTimeValue): void
{
if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) {
@@ -70,9 +68,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/ExcelToTimestamp1900.php';
}
- /**
- * @dataProvider providerDateTimeTimestampToExcel1900
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeTimestampToExcel1900')]
public function testDateTimeTimestampToExcel1900(float|int $expectedResult, float|int|string $unixTimestamp): void
{
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
@@ -86,9 +82,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/TimestampToExcel1900.php';
}
- /**
- * @dataProvider providerDateTimeDateTimeToExcel
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeDateTimeToExcel')]
public function testDateTimeDateTimeToExcel(float|int $expectedResult, DateTimeInterface $dateTimeObject): void
{
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
@@ -103,10 +97,9 @@ class DateTest extends TestCase
}
/**
- * @dataProvider providerDateTimeFormattedPHPToExcel1900
- *
* @param array{0: int, 1: int, 2: int, 3: int, 4: int, 5: float|int} $args Array containing year/month/day/hours/minutes/seconds
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeFormattedPHPToExcel1900')]
public function testDateTimeFormattedPHPToExcel1900(mixed $expectedResult, ...$args): void
{
Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
@@ -120,9 +113,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/FormattedPHPToExcel1900.php';
}
- /**
- * @dataProvider providerDateTimeExcelToTimestamp1904
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1904')]
public function testDateTimeExcelToTimestamp1904(float|int $expectedResult, float|int $excelDateTimeValue): void
{
if ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN) {
@@ -139,9 +130,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/ExcelToTimestamp1904.php';
}
- /**
- * @dataProvider providerDateTimeTimestampToExcel1904
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeTimestampToExcel1904')]
public function testDateTimeTimestampToExcel1904(mixed $expectedResult, float|int|string $unixTimestamp): void
{
Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
@@ -155,9 +144,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/TimestampToExcel1904.php';
}
- /**
- * @dataProvider providerIsDateTimeFormatCode
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerIsDateTimeFormatCode')]
public function testIsDateTimeFormatCode(mixed $expectedResult, string $format): void
{
$result = Date::isDateTimeFormatCode($format);
@@ -169,9 +156,7 @@ class DateTest extends TestCase
return require 'tests/data/Shared/Date/FormatCodes.php';
}
- /**
- * @dataProvider providerDateTimeExcelToTimestamp1900Timezone
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDateTimeExcelToTimestamp1900Timezone')]
public function testDateTimeExcelToTimestamp1900Timezone(float|int $expectedResult, float|int $excelDateTimeValue, string $timezone): void
{
if (is_numeric($expectedResult) && ($expectedResult > PHP_INT_MAX || $expectedResult < PHP_INT_MIN)) {
diff --git a/tests/PhpSpreadsheetTests/Shared/DrawingTest.php b/tests/PhpSpreadsheetTests/Shared/DrawingTest.php
index 972576e60..7eb41e643 100644
--- a/tests/PhpSpreadsheetTests/Shared/DrawingTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/DrawingTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class DrawingTest extends TestCase
{
- /**
- * @dataProvider providerPixelsToCellDimension
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPixelsToCellDimension')]
public function testPixelsToCellDimension(
float $expectedResult,
int $pixelSize,
@@ -27,9 +25,7 @@ class DrawingTest extends TestCase
self::assertSame($expectedResult, $result);
}
- /**
- * @dataProvider providerCellDimensionToPixels
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCellDimensionToPixels')]
public function testCellDimensionToPixels(
int $expectedResult,
int $cellSize,
diff --git a/tests/PhpSpreadsheetTests/Shared/ExactFontTest.php b/tests/PhpSpreadsheetTests/Shared/ExactFontTest.php
index c5a3aa0d8..fcae3303b 100644
--- a/tests/PhpSpreadsheetTests/Shared/ExactFontTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/ExactFontTest.php
@@ -82,7 +82,7 @@ class ExactFontTest extends TestCase
$this->directoryName = '';
}
- /** @dataProvider providerFontData */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFontData')]
public function testExact(string $fontName, float $excelWidth, float $xmlWidth, float $winWidth, float $ubuntuWidth): void
{
if ($this->incompleteMessage !== '') {
diff --git a/tests/PhpSpreadsheetTests/Shared/Font2Test.php b/tests/PhpSpreadsheetTests/Shared/Font2Test.php
index 2bfa429ef..e35ae3e3b 100644
--- a/tests/PhpSpreadsheetTests/Shared/Font2Test.php
+++ b/tests/PhpSpreadsheetTests/Shared/Font2Test.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class Font2Test extends TestCase
{
- /**
- * @dataProvider providerCharsetFromFontName
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCharsetFromFontName')]
public function testCharsetFromFontName(string $fontName, int $expectedResult): void
{
$result = Font::getCharsetFromFontName($fontName);
diff --git a/tests/PhpSpreadsheetTests/Shared/FontFileNameTest.php b/tests/PhpSpreadsheetTests/Shared/FontFileNameTest.php
index 5d45d720b..d953245ec 100644
--- a/tests/PhpSpreadsheetTests/Shared/FontFileNameTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/FontFileNameTest.php
@@ -39,9 +39,7 @@ class FontFileNameTest extends TestCase
Font::setExtraFontArray($this->holdExtraFontArray);
}
- /**
- * @dataProvider providerDefault
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerDefault')]
public function testDefaultFilenames(string $expected, array $fontArray): void
{
if ($expected === 'exception') {
@@ -81,9 +79,7 @@ class FontFileNameTest extends TestCase
];
}
- /**
- * @dataProvider providerMac
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerMac')]
public function testMacFilenames(string $expected, array $fontArray): void
{
if ($expected === 'exception') {
@@ -123,9 +119,7 @@ class FontFileNameTest extends TestCase
];
}
- /**
- * @dataProvider providerOverride
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOverride')]
public function testOverrideFilenames(string $expected, array $fontArray): void
{
Font::setTrueTypeFontPath(self::DEFAULT_DIRECTORY);
@@ -153,9 +147,7 @@ class FontFileNameTest extends TestCase
];
}
- /**
- * @dataProvider providerOverrideAbsolute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerOverrideAbsolute')]
public function testOverrideFilenamesAbsolute(string $expected, array $fontArray): void
{
$realPath = realpath(self::MAC_DIRECTORY) . DIRECTORY_SEPARATOR;
@@ -184,9 +176,7 @@ class FontFileNameTest extends TestCase
];
}
- /**
- * @dataProvider providerRecurse
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerRecurse')]
public function testRecurseFilenames(string $expected, array $fontArray): void
{
if ($expected === 'exception') {
diff --git a/tests/PhpSpreadsheetTests/Shared/FontTest.php b/tests/PhpSpreadsheetTests/Shared/FontTest.php
index e9b1a2ed8..c59cc3315 100644
--- a/tests/PhpSpreadsheetTests/Shared/FontTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/FontTest.php
@@ -41,9 +41,7 @@ class FontTest extends TestCase
self::assertFalse($result);
}
- /**
- * @dataProvider providerFontSizeToPixels
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerFontSizeToPixels')]
public function testFontSizeToPixels(float|int $expectedResult, float|int $size): void
{
$result = Font::fontSizeToPixels($size);
@@ -55,9 +53,7 @@ class FontTest extends TestCase
return require 'tests/data/Shared/FontSizeToPixels.php';
}
- /**
- * @dataProvider providerInchSizeToPixels
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerInchSizeToPixels')]
public function testInchSizeToPixels(float|int $expectedResult, float|int $size): void
{
$result = Font::inchSizeToPixels($size);
@@ -69,9 +65,7 @@ class FontTest extends TestCase
return require 'tests/data/Shared/InchSizeToPixels.php';
}
- /**
- * @dataProvider providerCentimeterSizeToPixels
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCentimeterSizeToPixels')]
public function testCentimeterSizeToPixels(float $expectedResult, float $size): void
{
$result = Font::centimeterSizeToPixels($size);
@@ -95,9 +89,7 @@ class FontTest extends TestCase
self::assertEquals(4, $width);
}
- /**
- * @dataProvider providerCalculateApproximateColumnWidth
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerCalculateApproximateColumnWidth')]
public function testCalculateApproximateColumnWidth(
float $expectedWidth,
StyleFont $font,
diff --git a/tests/PhpSpreadsheetTests/Shared/OLEPhpunit10Test.php b/tests/PhpSpreadsheetTests/Shared/OLEPhpunit10Test.php
index 7b97a979d..22505530d 100644
--- a/tests/PhpSpreadsheetTests/Shared/OLEPhpunit10Test.php
+++ b/tests/PhpSpreadsheetTests/Shared/OLEPhpunit10Test.php
@@ -11,9 +11,8 @@ use PHPUnit\Framework\TestCase;
* There were problems running these tests in OLETest with PhpUnit 10.
* These replacements seem to work. I want them run in separate
* processes because I am nervous about set_error_handler.
- *
- * @runTestsInSeparateProcesses
*/
+#[\PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses]
class OLEPhpunit10Test extends TestCase
{
private static string $errorString;
diff --git a/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php b/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php
index 78a89386c..e22a8e86b 100644
--- a/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/PasswordHasherTest.php
@@ -10,9 +10,7 @@ use PHPUnit\Framework\TestCase;
class PasswordHasherTest extends TestCase
{
- /**
- * @dataProvider providerHashPassword
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerHashPassword')]
public function testHashPassword(
string $expectedResult,
string $password,
diff --git a/tests/PhpSpreadsheetTests/Shared/PasswordReloadTest.php b/tests/PhpSpreadsheetTests/Shared/PasswordReloadTest.php
index 50b5b1f93..965d00300 100644
--- a/tests/PhpSpreadsheetTests/Shared/PasswordReloadTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/PasswordReloadTest.php
@@ -10,9 +10,7 @@ use PhpOffice\PhpSpreadsheetTests\Functional\AbstractFunctional;
class PasswordReloadTest extends AbstractFunctional
{
- /**
- * @dataProvider providerPasswords
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerPasswords')]
public function testPasswordReload(string $format, string $algorithm, bool $supported = true): void
{
$password = 'hello';
diff --git a/tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php b/tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php
index e6f26bf6e..47326f929 100644
--- a/tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/Trend/ExponentialBestFitTest.php
@@ -10,11 +10,10 @@ use PHPUnit\Framework\TestCase;
class ExponentialBestFitTest extends TestCase
{
/**
- * @dataProvider providerExponentialBestFit
- *
* @param array $yValues
* @param array $xValues
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerExponentialBestFit')]
public function testExponentialBestFit(
array $expectedSlope,
array $expectedIntersect,
diff --git a/tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php b/tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php
index e9de8a2e5..f23b9bfca 100644
--- a/tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php
+++ b/tests/PhpSpreadsheetTests/Shared/Trend/LinearBestFitTest.php
@@ -12,11 +12,10 @@ class LinearBestFitTest extends TestCase
const LBF_PRECISION = 1.0E-8;
/**
- * @dataProvider providerLinearBestFit
- *
* @param array $yValues
* @param array $xValues
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerLinearBestFit')]
public function testLinearBestFit(
array $expectedSlope,
array $expectedIntersect,
diff --git a/tests/PhpSpreadsheetTests/SpreadsheetTest.php b/tests/PhpSpreadsheetTests/SpreadsheetTest.php
index a35ab101f..5fbeb4fa4 100644
--- a/tests/PhpSpreadsheetTests/SpreadsheetTest.php
+++ b/tests/PhpSpreadsheetTests/SpreadsheetTest.php
@@ -52,9 +52,7 @@ class SpreadsheetTest extends TestCase
return $array;
}
- /**
- * @dataProvider dataProviderForSheetNames
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataProviderForSheetNames')]
public function testGetSheetByName(?int $index, string $sheetName): void
{
$spreadsheet = $this->getSpreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Style/ColorIndexTest.php b/tests/PhpSpreadsheetTests/Style/ColorIndexTest.php
index 31d980ebd..e2add4c2a 100644
--- a/tests/PhpSpreadsheetTests/Style/ColorIndexTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ColorIndexTest.php
@@ -9,9 +9,7 @@ use PHPUnit\Framework\TestCase;
class ColorIndexTest extends TestCase
{
- /**
- * @dataProvider providerColorIndexes
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColorIndexes')]
public function testColorIndex(string $expectedResult, string $xml, bool $background = false): void
{
$sxml = simplexml_load_string($xml);
diff --git a/tests/PhpSpreadsheetTests/Style/ColorTest.php b/tests/PhpSpreadsheetTests/Style/ColorTest.php
index 91f03e3fe..0b8093d68 100644
--- a/tests/PhpSpreadsheetTests/Style/ColorTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ColorTest.php
@@ -76,9 +76,7 @@ class ColorTest extends TestCase
self::assertEquals('FF123456', $color->getARGB());
}
- /**
- * @dataProvider providerColorGetRed
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColorGetRed')]
public function testGetRed(mixed $expectedResult, string $color, ?bool $bool = null): void
{
if ($bool === null) {
@@ -94,9 +92,7 @@ class ColorTest extends TestCase
return require 'tests/data/Style/Color/ColorGetRed.php';
}
- /**
- * @dataProvider providerColorGetGreen
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColorGetGreen')]
public function testGetGreen(mixed $expectedResult, string $color, ?bool $bool = null): void
{
if ($bool === null) {
@@ -112,9 +108,7 @@ class ColorTest extends TestCase
return require 'tests/data/Style/Color/ColorGetGreen.php';
}
- /**
- * @dataProvider providerColorGetBlue
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColorGetBlue')]
public function testGetBlue(mixed $expectedResult, string $color, ?bool $bool = null): void
{
if ($bool === null) {
@@ -130,9 +124,7 @@ class ColorTest extends TestCase
return require 'tests/data/Style/Color/ColorGetBlue.php';
}
- /**
- * @dataProvider providerColorChangeBrightness
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('providerColorChangeBrightness')]
public function testChangeBrightness(string $expectedResult, string $hexColorValue, float $adjustPercentages): void
{
$result = Color::changeBrightness($hexColorValue, $adjustPercentages);
diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/CellMatcherTest.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/CellMatcherTest.php
index 334736e87..00c026169 100644
--- a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/CellMatcherTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/CellMatcherTest.php
@@ -42,9 +42,7 @@ class CellMatcherTest extends TestCase
return $cfRange;
}
- /**
- * @dataProvider basicCellIsComparisonDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('basicCellIsComparisonDataProvider')]
public function testBasicCellIsComparison(string $sheetname, string $cellAddress, array $expectedMatches): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -112,9 +110,7 @@ class CellMatcherTest extends TestCase
$this->spreadsheet->getSheetByNameOrThrow($sheetname);
}
- /**
- * @dataProvider rangeCellIsComparisonDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rangeCellIsComparisonDataProvider')]
public function testRangeCellIsComparison(string $sheetname, string $cellAddress, bool $expectedMatch): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -153,9 +149,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider cellIsExpressionMultipleDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellIsExpressionMultipleDataProvider')]
public function testCellIsMultipleExpression(string $sheetname, string $cellAddress, array $expectedMatches): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -187,9 +181,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider cellIsExpressionDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('cellIsExpressionDataProvider')]
public function testCellIsExpression(string $sheetname, string $cellAddress, bool $expectedMatch): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -231,9 +223,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider textExpressionsDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('textExpressionsDataProvider')]
public function testTextExpressions(string $sheetname, string $cellAddress, bool $expectedMatch): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -339,9 +329,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider blanksDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('blanksDataProvider')]
public function testBlankExpressions(string $sheetname, string $cellAddress, array $expectedMatches): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -370,9 +358,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider errorDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('errorDataProvider')]
public function testErrorExpressions(string $sheetname, string $cellAddress, array $expectedMatches): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -400,9 +386,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider dateOccurringDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dateOccurringDataProvider')]
public function testDateOccurringExpressions(string $sheetname, string $cellAddress, bool $expectedMatch): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -442,9 +426,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider duplicatesDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('duplicatesDataProvider')]
public function testDuplicatesExpressions(string $sheetname, string $cellAddress, array $expectedMatches): void
{
$this->spreadsheet = $this->loadSpreadsheet();
@@ -476,9 +458,7 @@ class CellMatcherTest extends TestCase
];
}
- /**
- * @dataProvider textCrossWorksheetDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('textCrossWorksheetDataProvider')]
public function testCrossWorksheetExpressions(string $sheetname, string $cellAddress, bool $expectedMatch): void
{
$this->spreadsheet = $this->loadSpreadsheet();
diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/CellValueWizardTest.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/CellValueWizardTest.php
index d16ca99ea..2dc0a2463 100644
--- a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/CellValueWizardTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/CellValueWizardTest.php
@@ -24,9 +24,7 @@ class CellValueWizardTest extends TestCase
$this->style = new Style();
}
- /**
- * @dataProvider basicCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('basicCellValueDataProvider')]
public function testBasicCellValueWizard(string $operator, mixed $operand, string $expectedOperator, mixed $expectedCondition): void
{
$ruleType = Wizard::CELL_VALUE;
@@ -63,9 +61,7 @@ class CellValueWizardTest extends TestCase
];
}
- /**
- * @dataProvider relativeCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('relativeCellValueDataProvider')]
public function testRelativeCellValueWizard(mixed $operand, mixed $expectedCondition): void
{
$ruleType = Wizard::CELL_VALUE;
@@ -94,9 +90,7 @@ class CellValueWizardTest extends TestCase
];
}
- /**
- * @dataProvider formulaCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('formulaCellValueDataProvider')]
public function testCellValueWizardWithFormula(mixed $operand, mixed $expectedCondition): void
{
$ruleType = Wizard::CELL_VALUE;
@@ -129,9 +123,7 @@ class CellValueWizardTest extends TestCase
];
}
- /**
- * @dataProvider rangeCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rangeCellValueDataProvider')]
public function testRangeCellValueWizard(string $operator, array $operands, string $expectedOperator): void
{
$ruleType = Wizard::CELL_VALUE;
@@ -161,9 +153,7 @@ class CellValueWizardTest extends TestCase
];
}
- /**
- * @dataProvider rangeRelativeCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rangeRelativeCellValueDataProvider')]
public function testRelativeRangeCellValueWizard(array $operands, array $expectedConditions): void
{
$ruleType = Wizard::CELL_VALUE;
@@ -193,9 +183,7 @@ class CellValueWizardTest extends TestCase
];
}
- /**
- * @dataProvider rangeFormulaCellValueDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('rangeFormulaCellValueDataProvider')]
public function testFormulaRangeCellValueWizard(array $operands, array $expectedConditions): void
{
$ruleType = Wizard::CELL_VALUE;
diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/DateValueWizardTest.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/DateValueWizardTest.php
index 57778fc8d..cb2175bc6 100644
--- a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/DateValueWizardTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/DateValueWizardTest.php
@@ -24,9 +24,7 @@ class DateValueWizardTest extends TestCase
$this->style = new Style();
}
- /**
- * @dataProvider dateValueWizardProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dateValueWizardProvider')]
public function testDateValueWizard(string $operator, string $expectedReference, string $expectedExpression): void
{
$ruleType = Wizard::DATES_OCCURRING;
diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/ExpressionWizardTest.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/ExpressionWizardTest.php
index 770af66af..d01281423 100644
--- a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/ExpressionWizardTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/ExpressionWizardTest.php
@@ -24,9 +24,7 @@ class ExpressionWizardTest extends TestCase
$this->style = new Style();
}
- /**
- * @dataProvider expressionDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('expressionDataProvider')]
public function testExpressionWizard(string $expression, string $expectedExpression): void
{
$ruleType = Wizard::EXPRESSION;
@@ -46,9 +44,7 @@ class ExpressionWizardTest extends TestCase
self::assertEquals($newWizard, $wizard, 'fromConditional() Failure');
}
- /**
- * @dataProvider expressionDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('expressionDataProvider')]
public function testExpressionWizardUsingAlias(string $expression, string $expectedExpression): void
{
$ruleType = Wizard::EXPRESSION;
diff --git a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/WizardFactoryTest.php b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/WizardFactoryTest.php
index 5002bcaa1..46f500860 100644
--- a/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/WizardFactoryTest.php
+++ b/tests/PhpSpreadsheetTests/Style/ConditionalFormatting/Wizard/WizardFactoryTest.php
@@ -21,10 +21,9 @@ class WizardFactoryTest extends TestCase
}
/**
- * @dataProvider basicWizardFactoryProvider
- *
* @psalm-param class-string