PHPackages                             olmer/magento-unit-tests-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. olmer/magento-unit-tests-generator

ActiveLibrary

olmer/magento-unit-tests-generator
==================================

Unit Tests Generator

0.6.2(2y ago)4862.5k↓23.5%8[1 issues](https://github.com/olmer/magento-unit-tests-generator/issues)MITPHPPHP ^7.0 || ^8.0

Since Jun 29Pushed 2y ago2 watchersCompare

[ Source](https://github.com/olmer/magento-unit-tests-generator)[ Packagist](https://packagist.org/packages/olmer/magento-unit-tests-generator)[ RSS](/packages/olmer-magento-unit-tests-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (10)Used By (0)

Magento 2 module unit tests generator
=====================================

[](#magento-2-module-unit-tests-generator)

Sometimes writing new unit test for class with multiple dependencies may be tedious, so this package is intended to simplify magento2 unit tests creation. Command reads source file and generates basic unit test structure for specified class. If unit test already exists - nothing will happen. Test class is placed into test object class' module under app/code/Vendor/Module/Test/Unit/...

### How to install

[](#how-to-install)

```
composer require olmer/magento-unit-tests-generator --dev
php bin/magento cache:clean
php bin/magento setup:di:compile
```

### How to generate a unit test for a specific class

[](#how-to-generate-a-unit-test-for-a-specific-class)

```
php bin/magento dev:tests:generate-unit /app/code/Vendor/Module/path/to/file.php
```

### Examples

[](#examples)

Source class

```
