Skip to content

Commit 3f70e6d

Browse files
authored
Merge pull request #1783 from algolia/feat/MAGE-1363-phpunit-10
MAGE-1363 PHPUnit 10 prep
2 parents d79ed54 + a8b4b6e commit 3f70e6d

File tree

9 files changed

+16
-21
lines changed

9 files changed

+16
-21
lines changed

Test/Integration/Frontend/Category/CategoryCacheTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class CategoryCacheTest extends AbstractController
2323
public static function getCategoryProvider(): array
2424
{
2525
return [
26-
['categoryId' => 20, 'name' => 'Women', 'hasProducts' => false],
27-
['categoryId' => 21, 'name' => 'Women > Tops', 'hasProducts' => true],
28-
['categoryId' => 22, 'name' => 'Women > Bottoms', 'hasProducts' => true],
29-
['categoryId' => 11, 'name' => 'Men', 'hasProducts' => false],
30-
['categoryId' => 12, 'name' => 'Men > Tops', 'hasProducts' => true],
31-
['categoryId' => 13, 'name' => 'Men > Bottoms', 'hasProducts' => true],
26+
[20, 'Women', false],
27+
[21, 'Women > Tops', true],
28+
[22, 'Women > Bottoms', true],
29+
[11, 'Men', false],
30+
[12, 'Men > Tops', true],
31+
[13, 'Men > Bottoms', true],
3232
];
3333
}
3434

Test/Integration/TestCase.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@
1919
use Magento\Store\Model\ScopeInterface;
2020
use Magento\TestFramework\Helper\Bootstrap;
2121

22-
if (class_exists('PHPUnit\Framework\TestCase')) {
23-
class_alias('PHPUnit\Framework\TestCase', '\TC');
24-
} else {
25-
class_alias('\PHPUnit_Framework_TestCase', '\TC');
26-
}
27-
28-
abstract class TestCase extends \TC
22+
abstract class TestCase extends \PHPUnit\Framework\TestCase
2923
{
3024
/**
3125
* @var ObjectManagerInterface

Test/Unit/Controller/Adminhtml/IndexingManager/ReindexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function testEntityToIndex($params, $result)
185185
$this->assertEquals($result, $this->reindexController->defineEntitiesToIndex($params));
186186
}
187187

188-
public function entityParamsProvider()
188+
public static function entityParamsProvider(): array
189189
{
190190
return [
191191
[
@@ -219,7 +219,7 @@ public function testRedirectPath($params, $result)
219219
$this->assertEquals($result, $this->reindexController->defineRedirectPath($params));
220220
}
221221

222-
public function redirectParamsProvider()
222+
public static function redirectParamsProvider(): array
223223
{
224224
return [
225225
[

Test/Unit/Logger/Handler/AbstractHandlerTest.php renamed to Test/Unit/Logger/Handler/AbstractHandlerTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Magento\Framework\Logger\Handler\Base;
66
use PHPUnit\Framework\TestCase;
77

8-
abstract class AbstractHandlerTest extends TestCase
8+
abstract class AbstractHandlerTestCase extends TestCase
99
{
1010
protected ?Base $handler = null;
1111

Test/Unit/Logger/Handler/AlgoliaLoggerHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Algolia\AlgoliaSearch\Logger\Handler\AlgoliaLoggerHandler;
66
use Magento\Framework\Filesystem\DriverInterface;
77

8-
class AlgoliaLoggerHandlerTest extends AbstractHandlerTest
8+
class AlgoliaLoggerHandlerTest extends AbstractHandlerTestCase
99
{
1010
protected function setUp(): void
1111
{

Test/Unit/Logger/Handler/SystemLoggerHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Magento\Framework\Filesystem\DriverInterface;
77
use Magento\Framework\Logger\Handler\Exception as ExceptionHandler;
88

9-
class SystemLoggerHandlerTest extends AbstractHandlerTest
9+
class SystemLoggerHandlerTest extends AbstractHandlerTestCase
1010
{
1111
/**
1212
* @throws \Exception

Test/Unit/Model/Backend/QueueCronTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testInput($value, $isValid): void
5252
}
5353
}
5454

55-
public function valuesProvider(): array
55+
public static function valuesProvider(): array
5656
{
5757
return [
5858
[

Test/Unit/Service/EventProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testObjectDataForPurchase($priceIncludesTax, $orderItemsData, $e
6868
$this->assertEquals($expectedTotalRevenue, $totalRevenue);
6969
}
7070

71-
public function orderItemsProvider(): array
71+
public static function orderItemsProvider(): array
7272
{
7373
return [
7474
[ // One item

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
}
2525
],
2626
"require-dev": {
27-
"phpcompatibility/php-compatibility": "^9.2"
27+
"phpcompatibility/php-compatibility": "^9.2",
28+
"phpunit/phpunit": "^9.5|^10.5"
2829
},
2930
"autoload": {
3031
"files": [ "registration.php" ],

0 commit comments

Comments
 (0)