Skip to content

Commit 30d6dec

Browse files
committed
Merge remote-tracking branch 'origin/MC-34231' into 2.4.0-develop-pr33
2 parents c61b953 + ae27a72 commit 30d6dec

File tree

2 files changed

+9
-8
lines changed
  • app/code/Magento/Theme/Test/Unit/Model/Design/Backend
  • dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav

2 files changed

+9
-8
lines changed

app/code/Magento/Theme/Test/Unit/Model/Design/Backend/ImageTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ImageTest extends \PHPUnit\Framework\TestCase
3636
/**
3737
* @inheritdoc
3838
*/
39-
public function setUp()
39+
public function setUp() : void
4040
{
4141
$context = $this->getMockObject(Context::class);
4242
$registry = $this->getMockObject(Registry::class);
@@ -70,7 +70,7 @@ public function setUp()
7070
/**
7171
* @inheritdoc
7272
*/
73-
public function tearDown()
73+
public function tearDown() : void
7474
{
7575
unset($this->imageBackend);
7676
}
@@ -92,12 +92,12 @@ private function getMockObject(string $class, array $methods = []): \PHPUnit\Fra
9292

9393
/**
9494
* Test for beforeSave method with invalid file extension.
95-
*
96-
* @expectedException \Magento\Framework\Exception\LocalizedException
97-
* @expectedExceptionMessage Something is wrong with the file upload settings.
9895
*/
9996
public function testBeforeSaveWithInvalidExtensionFile()
10097
{
98+
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
99+
$this->expectExceptionMessage('Something is wrong with the file upload settings.');
100+
101101
$invalidFileName = 'fileName.invalidExtension';
102102
$this->imageBackend->setData(
103103
[

dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Eav/AttributeTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Eav\Api\AttributeRepositoryInterface;
99
use Magento\Eav\Api\Data\AttributeInterface;
1010
use Magento\Eav\Model\Config;
11+
use Magento\Framework\Exception\LocalizedException;
1112
use Magento\Framework\ObjectManagerInterface;
1213
use Magento\TestFramework\Helper\Bootstrap;
1314

@@ -67,13 +68,13 @@ public function testCRUD()
6768
/**
6869
* @magentoDataFixture Magento/Catalog/_files/product_attribute.php
6970
*
70-
* @expectedException \Magento\Framework\Exception\LocalizedException
71-
* @expectedExceptionMessage Do not change entity type.
72-
*
7371
* @return void
7472
*/
7573
public function testAttributeSaveWithChangedEntityType(): void
7674
{
75+
$this->expectException(LocalizedException::class);
76+
$this->expectExceptionMessage('Do not change entity type.');
77+
7778
$attribute = $this->attributeRepository->get($this->catalogProductEntityType, 'test_attribute_code_333');
7879
$attribute->setEntityTypeId(1);
7980
$attribute->save();

0 commit comments

Comments
 (0)