Skip to content

Commit 8e1d2e7

Browse files
committed
Fix Unintential Deprecated Calls in Tests - LOOKUPREF
I think it's best to install these before PR PHPOffice#3166. There are no changes to source code, only to test members which continue to inadvertently use calls to deprecated functions.
1 parent bbfaa0c commit 8e1d2e7

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AddressTest extends TestCase
1515
*/
1616
public function testADDRESS($expectedResult, ...$args): void
1717
{
18-
$result = LookupRef::cellAddress(...$args);
18+
$result = LookupRef\Address::cell(...$args);
1919
self::assertEquals($expectedResult, $result);
2020
}
2121

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ChooseTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
87
use PHPUnit\Framework\TestCase;
98

109
class ChooseTest extends TestCase
1110
{
12-
protected function setUp(): void
13-
{
14-
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
15-
}
16-
1711
/**
1812
* @dataProvider providerCHOOSE
1913
*
2014
* @param mixed $expectedResult
2115
*/
2216
public function testCHOOSE($expectedResult, ...$args): void
2317
{
24-
$result = LookupRef::CHOOSE(...$args);
18+
$result = LookupRef\Selection::choose(...$args);
2519
self::assertEquals($expectedResult, $result);
2620
}
2721

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ColumnsTest extends TestCase
1616
*/
1717
public function testCOLUMNS($expectedResult, $arg): void
1818
{
19-
$result = LookupRef::COLUMNS($arg);
19+
$result = LookupRef\RowColumnInformation::COLUMNS($arg);
2020
self::assertEquals($expectedResult, $result);
2121
}
2222

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/HLookupTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public function testGrandfathered(): void
7575
// Some old tests called function directly using array of strings;
7676
// ensure these work as before.
7777
$expectedResult = '#REF!';
78-
$result = LookupRef::HLOOKUP(
78+
$result = /** @scrutinizer ignore-deprecated */ LookupRef::HLOOKUP(
7979
'Selection column',
8080
['Selection column', 'Value to retrieve'],
8181
5,
8282
false
8383
);
8484
self::assertSame($expectedResult, $result);
8585
$expectedResult = 'Value to retrieve';
86-
$result = LookupRef::HLOOKUP(
86+
$result = /** @scrutinizer ignore-deprecated */ LookupRef::HLOOKUP(
8787
'Selection column',
8888
['Selection column', 'Value to retrieve'],
8989
2,

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/LookupTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@
33
namespace PhpOffice\PhpSpreadsheetTests\Calculation\Functions\LookupRef;
44

55
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
6-
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
76
use PhpOffice\PhpSpreadsheet\Calculation\LookupRef;
87
use PHPUnit\Framework\TestCase;
98

109
class LookupTest extends TestCase
1110
{
12-
protected function setUp(): void
13-
{
14-
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
15-
}
16-
1711
/**
1812
* @dataProvider providerLOOKUP
1913
*
2014
* @param mixed $expectedResult
2115
*/
2216
public function testLOOKUP($expectedResult, ...$args): void
2317
{
24-
$result = LookupRef::LOOKUP(...$args);
18+
$result = LookupRef\Lookup::lookup(...$args);
2519
self::assertEquals($expectedResult, $result);
2620
}
2721

tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RowsTest extends TestCase
1616
*/
1717
public function testROWS($expectedResult, $arg): void
1818
{
19-
$result = LookupRef::ROWS($arg);
19+
$result = LookupRef\RowColumnInformation::ROWS($arg);
2020
self::assertEquals($expectedResult, $result);
2121
}
2222

0 commit comments

Comments
 (0)