Skip to content

Commit 8564b42

Browse files
committed
AC-11633::Unit test failure with PHP 8.3 in Jenkins Build
1 parent 28ad228 commit 8564b42

File tree

2 files changed

+3
-3
lines changed
  • app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization
  • lib/internal/Magento/Framework/TestFramework/Unit/Helper

2 files changed

+3
-3
lines changed

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function setUp(): void
151151
->disableOriginalConstructor()
152152
->getMockForAbstractClass();
153153
$productExtensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class)
154-
->addMethods(['getCategoryLinks', 'setCategoryLinks'])
154+
->onlyMethods(['getCategoryLinks', 'setCategoryLinks'])
155155
->getMockForAbstractClass();
156156
$this->productMock->setExtensionAttributes($productExtensionAttributes);
157157

@@ -788,6 +788,6 @@ private function prepareObjectManager($map)
788788

789789
$reflectionProperty = new \ReflectionProperty(\Magento\Framework\App\ObjectManager::class, '_instance');
790790
$reflectionProperty->setAccessible(true);
791-
$reflectionProperty->setValue($objectManagerMock, null);
791+
$reflectionProperty->setValue($objectManagerMock, $objectManagerMock);
792792
}
793793
}

lib/internal/Magento/Framework/TestFramework/Unit/Helper/ObjectManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,6 @@ public function prepareObjectManager(array $map = [])
380380

381381
$reflectionProperty = new \ReflectionProperty(AppObjectManager::class, '_instance');
382382
$reflectionProperty->setAccessible(true);
383-
$reflectionProperty->setValue($objectManagerMock, null);
383+
$reflectionProperty->setValue($objectManagerMock, $objectManagerMock);
384384
}
385385
}

0 commit comments

Comments
 (0)