Magento – How we can create unit tests to everything we have created for our custom module in Magento 2

magento2phpunitunit tests

I have created a module in magento 2. And need to create the Unit tests for it.
I can see that Each core module has its own Test folder containing tests for each component like Controller, Block,Model,etc.

But they are hard to understand, and magento has not provided the tuttorial for the same. can anyone suggest any source where i can learn the unittesting framework from basics?

I got idea how to test it but I don't know how to create it.
http://devdocs.magento.com/guides/v2.0/mtf/mtf_update.html

Please help to do this stuff.

Best Answer

The best I can suggest for now is reading up on PHP Unit and looking at other test scripts provided with the code base. I do not recall more unit testing examples being high on the doc teams list at the moment.

Some other reading that might be useful.