Magento 2 Get Current Module directory full path programmatically.

You can Retrieve full path to a directory of a certain type within a module using Magento 2.

Magento\Framework\Module\Dir and Magento\Framework\Module\Dir\Reader class used for getting the full path of Current modules any directory path like i18n, etc, view or Controller. Continue reading “Magento 2 Get Current Module directory full path programmatically.”

How to write PHPUnit Test for a module in Magento 2?

All the Core module in Magento natively comes with Unit and Integration Test.

As a professional Developer, When you create any module for your project, You should have to write Unit Test for your module code to validate your code is errorless.

Write a Unit test for your module, Gives guarantee your code is bug-free with Find problems earlier before going live and if any error available for a code, you can update the code before code is going to a production server. Continue reading “How to write PHPUnit Test for a module in Magento 2?”