---
title: "Discussion on \"Create a PHPUnit Test in Magento 2\" | Hashnode"
description: "Discussion on \"Create a PHPUnit Test in Magento 2\". In your module create a Test folder and add a unit test file\napp\\code\\AzCodez\\MagentoTraining\\Test\\Unit\\TestUnitTest.php\nAdd code to your test class\n<?php\n\nuse PHPUnit\\Framework\\TestCase;\n\nclass TestUnitTest extends TestCase\n{\n    public function tes..."
url: "https://hashnode.com/posts/create-a-phpunit-test-in-magento-2/61744f230f452c1cd94fa6be"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Create a PHPUnit Test in Magento 2](https://blog.azcodez.com/create-a-phpunit-test-in-magento-2?utm_source=hashnode&utm_medium=feed)

In your module create a Test folder and add a unit test file app\\code\\AzCodez\\MagentoTraining\\Test\\Unit\\TestUnitTest.php Add code to your test class <?php use PHPUnit\\Framework\\TestCase; class TestUnitTest extends TestCase { public function tes...

Oct 23, 2021 · 1 min read · blog.azcodez.com  
Updated Aug 6, 2022  
Read the article

-   [#php](https://hashnode.com/tag/php)
-   [#magento](https://hashnode.com/tag/magento)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)

## Written by

[Asrin Dayananda](https://hashnode.com/@azcodez)

@azcodez · United Kingdom

  
[View profile](https://hashnode.com/@azcodez)

Cloud & Software Engineer 👨‍💻

Software engineer focusing on PHP, JavaScript, HTML, CSS, CI/CD, GitHub, AWS, Azure &amp; Magento Commerce. I enjoy code for good projects, tech, gym, nature, travel, fried chicken, and coffee. All my articles are educational only from my experience. Feel free to connect.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
