Magento 2 : Installation & Varnish Test Results Failed => Class Does not exist Magento Marketplace
-
15-04-2021 - |
Question
We have created the custom module and uploaded to Magento Marketplace and Installation & Varnish Test has been failed due to class does not exist.
If the class not exists, How the Code Sniffer passed?
But the class is exists. Don't know why extension is failed.
We have a custom interface ConnectorCustomerRepositoryInterface, The Testing says the class does not exist.
The classes are below:
<?php
namespace ABCSolutions\Connector365\Api\Customer
interface ConnectorCustomerRepositoryInterface{
..
}
and the extended Class
<?php
namespace ABCSolutions\Connector365\Model\ResourceModel;
class CustomerRepository implements \ABCSolutions\Connector365\Api\Customer\ConnectorCustomerRepositoryInterface{
...
}
And the di.xml
<preference for="ABCSolutions\Connector365\Api\Customer\ConnectorCustomerRepositoryInterface" type="ABCSolutions\Connector365\Model\ResourceModel\CustomerRepository"/>
And webapi.xml
file
<route url="/V1/connector/Customer_MultiCreate" method="POST">
<service class="ABCSolutions\Connector365\Api\Customer\ConnectorCustomerRepositoryInterface" method="Customer_MultiCreate"/>
<resources>
<resources ref="Magento_Customer::customer"/>
</resources>
</route>
And Installed the Varnish in my local magento system and compiled everything working in my local system.
Any help on this?
Solution 2
Finally, got the solution. Everything was fine except my composer. In the composer the Case sensitivity is missed of Package and Module Name from PSR-4
section. Now the extension was passed and under marketing review soon will avail in Magento Marketplace. Thanks to #MagentoTeam on the help.
OTHER TIPS
- Make sure that the module overriding the CustomerRepositoryInterface is enabled
- Make sure that after enabling the module, all DIs are compiled properly
- Make sure that the directory structure of the overriding class matches with the namespace declaration
While you are checking above 3 items, please update your question with the XML file that tells the base CustomerRepositoryInterface is overriden by your custom interface