Skip to content

Commit 399a156

Browse files
committed
Merge remote-tracking branch 'gl_magento2ce/AC-8834' into BUG#AC-8834
2.4.7-Beta1-Composer Integration Test Failures-PHP 8.2
2 parents 712e80c + fb90b04 commit 399a156

File tree

9 files changed

+20
-17
lines changed

9 files changed

+20
-17
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function setUp(): void
5454
public function testValidate(): void
5555
{
5656
$this->expectException(LocalizedException::class);
57-
$this->expectErrorMessage((string)__('Please enter a valid number in this field.'));
57+
$this->expectExceptionMessage((string)__('Please enter a valid number in this field.'));
5858
$product = $this->productFactory->create();
5959
$product->setQuantityAndStockStatus(['qty' => 'string']);
6060
$this->model->validate($product);

dev/tests/integration/testsuite/Magento/Catalog/Model/Product/AuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function postRequestData(): array
136136
public function testAuthorizedSavingOfWithException(array $data): void
137137
{
138138
$this->expectException(AuthorizationException::class);
139-
$this->expectErrorMessage('Not allowed to edit the product\'s design attributes');
139+
$this->expectExceptionMessage('Not allowed to edit the product\'s design attributes');
140140
$this->request->setPost(new Parameters($data));
141141

142142
/** @var Product $product */

dev/tests/integration/testsuite/Magento/Catalog/Model/ProductWebsiteLinkRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testSaveWithoutWebsiteId(): void
6565
$productWebsiteLink = $this->productWebsiteLinkFactory->create();
6666
$productWebsiteLink->setSku('unique-simple-azaza');
6767
$this->expectException(InputException::class);
68-
$this->expectErrorMessage((string)__('There are not websites for assign to product'));
68+
$this->expectExceptionMessage((string)__('There are not websites for assign to product'));
6969
$this->productWebsiteLinkRepository->save($productWebsiteLink);
7070
}
7171

dev/tests/integration/testsuite/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/SuffixTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* @magentoAppArea adminhtml
3333
* @magentoDbIsolation enabled
3434
* @magentoAppIsolation enabled
35+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3536
*/
3637
class SuffixTest extends TestCase
3738
{
@@ -83,7 +84,7 @@ protected function setUp(): void
8384
public function testSaveWithError(): void
8485
{
8586
$this->expectException(LocalizedException::class);
86-
$this->expectErrorMessage((string)__('Anchor symbol (#) is not supported in url rewrite suffix.'));
87+
$this->expectExceptionMessage((string)__('Anchor symbol (#) is not supported in url rewrite suffix.'));
8788
$this->model->setValue('.html#');
8889
$this->model->beforeSave();
8990
}

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/ConfigurableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ protected function getUsedProducts()
656656
*/
657657
public function testAddCustomOptionToConfigurableChildProduct(): void
658658
{
659-
$this->expectErrorMessage(
659+
$this->expectExceptionMessage(
660660
'Required custom options cannot be added to a simple product that is a part of a composite product.'
661661
);
662662

dev/tests/integration/testsuite/Magento/Framework/App/ResourceConnection/ConnectionFactoryTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function testCreate()
3636
];
3737
$connection = $this->model->create($dbConfig);
3838
$this->assertInstanceOf(\Magento\Framework\DB\Adapter\AdapterInterface::class, $connection);
39-
$this->assertClassHasAttribute('logger', get_class($connection));
39+
$this->assertIsObject($connection);
40+
$this->assertTrue(property_exists($connection, 'logger'));
4041
$object = new ReflectionClass(get_class($connection));
4142
$attribute = $object->getProperty('logger');
4243
$attribute->setAccessible(true);

dev/tests/integration/testsuite/Magento/Framework/ObjectManager/ObjectManagerTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ class ObjectManagerTest extends \PHPUnit\Framework\TestCase
1212
/**#@+
1313
* Test class with type error
1414
*/
15-
const TEST_CLASS_WITH_TYPE_ERROR = \Magento\Framework\ObjectManager\TestAsset\ConstructorWithTypeError::class;
15+
public const TEST_CLASS_WITH_TYPE_ERROR = \Magento\Framework\ObjectManager\TestAsset\ConstructorWithTypeError::class;
1616

1717
/**#@+
1818
* Test classes for basic instantiation
1919
*/
20-
const TEST_CLASS = \Magento\Framework\ObjectManager\TestAsset\Basic::class;
20+
public const TEST_CLASS = \Magento\Framework\ObjectManager\TestAsset\Basic::class;
2121

22-
const TEST_CLASS_INJECTION = \Magento\Framework\ObjectManager\TestAsset\BasicInjection::class;
22+
public const TEST_CLASS_INJECTION = \Magento\Framework\ObjectManager\TestAsset\BasicInjection::class;
2323

2424
/**#@-*/
2525

2626
/**#@+
2727
* Test classes and interface to test preferences
2828
*/
29-
const TEST_INTERFACE = \Magento\Framework\ObjectManager\TestAsset\TestAssetInterface::class;
29+
public const TEST_INTERFACE = \Magento\Framework\ObjectManager\TestAsset\TestAssetInterface::class;
3030

31-
const TEST_INTERFACE_IMPLEMENTATION = \Magento\Framework\ObjectManager\TestAsset\InterfaceImplementation::class;
31+
public const TEST_INTERFACE_IMPLEMENTATION = \Magento\Framework\ObjectManager\TestAsset\InterfaceImplementation::class;
3232

33-
const TEST_CLASS_WITH_INTERFACE = \Magento\Framework\ObjectManager\TestAsset\InterfaceInjection::class;
33+
public const TEST_CLASS_WITH_INTERFACE = \Magento\Framework\ObjectManager\TestAsset\InterfaceInjection::class;
3434

3535
/**#@-*/
3636

@@ -141,7 +141,8 @@ public function testNewInstance($actualClassName, array $properties = [], $expec
141141
$object = new ReflectionClass($actualClassName);
142142
if ($properties) {
143143
foreach ($properties as $propertyName => $propertyClass) {
144-
$this->assertClassHasAttribute($propertyName, $actualClassName);
144+
$this->assertIsObject($testObject);
145+
$this->assertTrue(property_exists($testObject, $propertyName));
145146
$attribute = $object->getProperty($propertyName);
146147
$attribute->setAccessible(true);
147148
$propertyObject = $attribute->getValue($testObject);

dev/tests/integration/testsuite/Magento/Framework/ProfilerTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
* Test case for \Magento\Framework\Profiler
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -25,7 +23,8 @@ public function testApplyConfigWithDrivers(array $config, array $expectedDrivers
2523
{
2624
$profiler = new \Magento\Framework\Profiler();
2725
$profiler::applyConfig($config, '');
28-
$this->assertClassHasAttribute('_drivers', \Magento\Framework\Profiler::class);
26+
$this->assertIsObject($profiler);
27+
$this->assertTrue(property_exists($profiler, '_drivers'));
2928
$object = new ReflectionClass(\Magento\Framework\Profiler::class);
3029
$attribute = $object->getProperty('_drivers');
3130
$attribute->setAccessible(true);

dev/tests/integration/testsuite/Magento/ImportExport/Model/ExportTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public function testGetEntityAdapterWithValidEntity($entity, $expectedEntityType
3535
{
3636
$this->_model->setData(['entity' => $entity]);
3737
$this->_model->getEntityAttributeCollection();
38-
$this->assertClassHasAttribute('_entityAdapter', get_class($this->_model));
38+
$this->assertIsObject($this->_model);
39+
$this->assertTrue(property_exists($this->_model, '_entityAdapter'));
3940
$object = new ReflectionClass(get_class($this->_model));
4041
$attribute = $object->getProperty('_entityAdapter');
4142
$attribute->setAccessible(true);

0 commit comments

Comments
 (0)