Open
Description
Preconditions
- Magento 2.1.0 ans seems still actual for
2.4-develop
Steps to reproduce
- Write an integration test case as follows:
public function testCategoryAttributeExists($attributeCode)
{
$categoryAttributesRepository = \Magento\TestFramework\ObjectManager::getInstance()->get(
\Magento\Catalog\Api\CategoryAttributeRepositoryInterface::class
);
$this->assertInstanceOf(
\Magento\Catalog\Api\Data\CategoryAttributeInterface::class,
$categoryAttributesRepository->get($attributeCode)
);
}
- Pass an existing attribute code via data provider
- Run the test
Expected result
- The test passes, because the contract of
Magento\Catalog\Api\CategoryAttributeRepositoryInterface
states:
/**
* Retrieve specific attribute
*
* @param string $attributeCode
* @return \Magento\Catalog\Api\Data\CategoryAttributeInterface
*/
public function get($attributeCode);
Actual result
- The test fails with a message like this
Failed asserting that Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor Object (...) is an instance of interface "Magento\Catalog\Api\Data\CategoryAttributeInterface".
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.The issue has been reproduced on latest 2.4-develop branchMajor restrictions or short-term circumventions are required until a fix is available.Issue related to Developer Experience and needs help with Triage to Confirm or Reject it