Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a command to generate test file #88

Open
CedCannes opened this issue Nov 26, 2015 · 2 comments
Open

Add a command to generate test file #88

CedCannes opened this issue Nov 26, 2015 · 2 comments

Comments

@CedCannes
Copy link

it would be convenient for people like me who have no memory or for programmers who want to get started quickly, having a command that generates a test class with everything needed to start.

For example :
With the command :

app/console atoum:generate:unittest AppBundle/DataTransformer/AwesomeDataTransformer

it would generate a file :

AppBundle/Tests/Units/DataTransformer/AwesomeDataTransformer.php

which would contain the test class and a basic test just to check that the test run well.
Like this :

<?php
namespace AppBundle\Tests\Units\DataTransformer;

use atoum;

class AwesomeDataTransformer extends atoum
{
    /**
     * this test is generated by atoum command
     *
     */
    public function testBasic()
    {
        $this
            ->if($this->newTestedInstance())
            ->then
            ->object($this->testedInstance)
                ->isTestedInstance();
    }

There generators in Symfony and that makes life easier sometimes.
I think the developers using Symfony would be more enthusiastic if can they could play quickly with atoum.

@Grummfy
Copy link
Member

Grummfy commented Nov 26, 2015

👍

@CedCannes
Copy link
Author

It appears there is already a generator in atoum.

https://github.com/atoum/atoum/blob/master/resources/templates/test/generator/testClass.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants