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?”

How to get all the disable module list Programmatically in Magento 2?

You can get the list of all the disabled module in Magento 2 by manually from app/etc/config.php.

Module with value equals to 0 is disable the module.

‘Klarna_Core’ => 0, Klarna Core is disable for system.

You can get all the Disable module list using Magento\Framework\Module\FullModuleList and Magento\Framework\Module\ModuleList class. Continue reading “How to get all the disable module list Programmatically in Magento 2?”

Magento 2 Get all the module list programmatically.

You can get the list of available modules in Magento 2. You can manually check your all the module list from app/etc/config.php

You can get all the Active module list using Magento\Framework\Module\FullModuleList class.

FullModuleList.php class used for getting all the module in Magento 2 whether its enable or disabled. Continue reading “Magento 2 Get all the module list programmatically.”