How to add CMS Page Programmatically using Patch Data in Magento 2?

From Magento 2.3, Core modules use the declarative schema approach rather than setup upgrade scripts. This is the new recommended approach for Magento versions 2.3 and upper version.

All the InstallData and UpgrageData will be replaced by Data Patch Versioning.

Now you have to create Setup/Patch/Data folder and create the class file for create/update attribute or add sample data in Magento.

Continue reading “How to add CMS Page Programmatically using Patch Data in Magento 2?”

What is Unit Testing in Magento 2?

Unit Testing Definition:

— UNIT TESTING is a software development process where individual units from a functional(programming) file or components of the software are tested automatically using code level.
— Main Intention for a Unit test is to validate each unit of the software performs as logic designed.
— The unit testing process is completely automatic without any manual testing for functionality.

Continue reading “What is Unit Testing in Magento 2?”

How to create dropdown select type category attribute programmatically in magento 2?

Magento 2, You can create a custom category attribute with a list of CMS blocks in the dropdown field.

The module is simply residing in the app/code folder of the Magento instance.

For example, We kept the Package name as Rbj and the Module name as CategoryAttribute.
You can keep any name for Packagename/Module name. In our demo, we have kept the Module name as Rbj_CategoryAttribute. Continue reading “How to create dropdown select type category attribute programmatically in magento 2?”