tomasz-kr/unittest-generator-entity

Generate simple phpunit test for your project.

dev-master 2018-02-12 21:53 UTC

README

Entity

Bundle is used to generate simple unit tests of Entities.

The only thing you need to pass is the Entity namespace:

Symfony 3.3

$ php bin/console unit-tests:generate:entity "<entity_namespace>"

Used

$ php bin/console unit-tests:generate:entity "AppBundle\Entity\MyEntity"

It will create simple unit test with Entity name in Bundle/Tests/ directory or tests/ or your path in project.

!!! Just remember to escape backslashes !!!

Installation

For Symfony Framework >= 3.3

Require the bundle and its dependencies with composer:

$ composer require tomasz-kr/unittest-generator-entity

Register the bundle:

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        new KCH\Bundle\UnitTests\Generator\EntityBundle\UnitTestsGeneratorEntityBundle(),
    );
}

Contributors

Tomasz Król

License

MIT

Fork

Oryginal repository