Skip to content

Commit 82c5d79

Browse files
committed
updated tests
1 parent 3df9d26 commit 82c5d79

File tree

24 files changed

+37
-36
lines changed

24 files changed

+37
-36
lines changed

tests/unit/Base/DefaultConfigTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Generator;
2121
use Mage;
2222
use Mage_Adminhtml_Helper_Dashboard_Data;
23+
use Mage_Core_Model_Store;
2324
use PHPUnit\Framework\TestCase;
2425

2526
class DefaultConfigTest extends TestCase
@@ -29,7 +30,7 @@ class DefaultConfigTest extends TestCase
2930
* @group Base
3031
* @group Default_Config
3132
*/
32-
public function testGetStoreConfig(string $expectedResult, string $path, $store = null): void
33+
public function testGetStoreConfig(string $expectedResult, string $path, bool|int|Mage_Core_Model_Store|null|string $store = null): void
3334
{
3435
static::assertSame($expectedResult, Mage::getStoreConfig($path, $store));
3536
}

tests/unit/Mage/Admin/Model/BlockTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public static function setUpBeforeClass(): void
3535

3636
/**
3737
* @dataProvider provideValidateAdminBlockData
38-
* @param array<int, string> $expectedResult
38+
* @param true|array<int, string> $expectedResult
3939
*
4040
* @group Mage_Admin
4141
* @group Mage_Admin_Model
4242
* @throws Exception
4343
*/
44-
public function testValidate($expectedResult, array $methods): void
44+
public function testValidate(bool|array $expectedResult, array $methods): void
4545
{
4646
$mock = $this->getMockBuilder(Subject::class)
4747
->setMethods([

tests/unit/Mage/Admin/Model/UserTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ public static function setUpBeforeClass(): void
3535

3636
/**
3737
* @dataProvider provideAuthenticateData
38-
* @param array|true $expectedResult
3938
* @group Mage_Admin
4039
* @group Mage_Admin_Model
4140
* @group runInSeparateProcess
4241
* @runInSeparateProcess
4342
*/
44-
public function testAuthenticate($expectedResult, array $methods): void
43+
public function testAuthenticate(string $expectedResult, array $methods): void
4544
{
4645
$mock = $this->getMockBuilder(Subject::class)
4746
->setMethods([

tests/unit/Mage/AdminNotification/Model/InboxTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static function setUpBeforeClass(): void
4242
* @group Mage_AdminNotification
4343
* @group Mage_AdminNotification_Model
4444
*/
45-
public function testGetSeverities($expectedResult, ?int $severity): void
45+
public function testGetSeverities(array|string|null $expectedResult, ?int $severity): void
4646
{
4747
static::assertSame($expectedResult, self::$subject->getSeverities($severity));
4848
}

tests/unit/Mage/Adminhtml/Helper/SalesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function setUpBeforeClass(): void
3838
* @group Mage_Adminhtml
3939
* @group Mage_Adminhtml_Helper
4040
*/
41-
public function testEscapeHtmlWithLinks($expectedResult, $data): void
41+
public function testEscapeHtmlWithLinks(string $expectedResult, string $data): void
4242
{
4343
static::assertSame($expectedResult, self::$subject->escapeHtmlWithLinks($data, ['a']));
4444
}

tests/unit/Mage/Catalog/Helper/DataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function setUpBeforeClass(): void
3838
* @group Mage_Catalog
3939
* @group Mage_Catalog_Helper
4040
*/
41-
public function testSplitSku($expectedResult, string $sku, int $length = 30): void
41+
public function testSplitSku(array $expectedResult, string $sku, int $length = 30): void
4242
{
4343
static::assertSame($expectedResult, self::$subject->splitSku($sku, $length));
4444
}

tests/unit/Mage/Catalog/Helper/ProductTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function provideGetAttributeInputTypes(): Generator
7676
* @group Mage_Catalog
7777
* @group Mage_Catalog_Helper
7878
*/
79-
public function testGetAttributeBackendModelByInputType($expectedResult, string $inputType): void
79+
public function testGetAttributeBackendModelByInputType(string $expectedResult, string $inputType): void
8080
{
8181
static::assertSame($expectedResult, self::$subject->getAttributeBackendModelByInputType($inputType));
8282
}
@@ -94,7 +94,7 @@ public function provideGetAttributeBackendModelByInputType(): Generator
9494
* @group Mage_Catalog
9595
* @group Mage_Catalog_Helper
9696
*/
97-
public function testGetAttributeSourceModelByInputType($expectedResult, string $inputType): void
97+
public function testGetAttributeSourceModelByInputType(string $expectedResult, string $inputType): void
9898
{
9999
static::assertSame($expectedResult, self::$subject->getAttributeSourceModelByInputType($inputType));
100100
}

tests/unit/Mage/Catalog/Model/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testGetUrlModel(): void
119119
* @group Mage_Catalog
120120
* @group Mage_Catalog_Model
121121
*/
122-
public function testFormatUrlKey($expectedResult, string $locale): void
122+
public function testFormatUrlKey(string $expectedResult, string $locale): void
123123
{
124124
self::$subject->setLocale($locale);
125125
static::assertSame($expectedResult, self::$subject->formatUrlKey($this->getTestString()));

tests/unit/Mage/Catalog/Model/Product/Option/Type/TextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testValidateUserValue(): void
5151
* @group Mage_Catalog
5252
* @group Mage_Catalog_Model
5353
*/
54-
public function testPrepareForCart($expectedResult, bool $setIsValid = true, $setUserValue = null): void
54+
public function testPrepareForCart(?string $expectedResult, bool $setIsValid = true, ?string $setUserValue = null): void
5555
{
5656
self::$subject->setIsValid($setIsValid)->setUserValue($setUserValue);
5757
static::assertSame($expectedResult, self::$subject->prepareForCart());

tests/unit/Mage/Catalog/Model/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function testAfterCommitCallback(): void
166166
* @group Mage_Catalog
167167
* @group Mage_Catalog_Model
168168
*/
169-
public function testFormatUrlKey($expectedResult, string $locale): void
169+
public function testFormatUrlKey(string $expectedResult, string $locale): void
170170
{
171171
self::$subject->setLocale($locale);
172172
static::assertSame($expectedResult, self::$subject->formatUrlKey($this->getTestString()));

0 commit comments

Comments
 (0)