fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

It's nice to generate its test code scaffolding when run oil generate something. #242

Closed watilde closed 9 years ago

watilde commented 9 years ago

Hi.

I like to use oil generate and oil test. When I run those commands, I always create a test code scaffolding by myself and it will take a little bit more effort. I'd like to generate easily, so I thought it's actually a nice to generate its test code scaffolding when run oil generate something.

e.g.

Current:

php oil g model post title:varchar[50] body:text user_id:int
    Created model: APPPATH/classes/model/post.php
    Created migration: APPPATH/migrations/001_create_posts.php

I wanted:

php oil g model post title:varchar[50] body:text user_id:int
    Created model: APPPATH/classes/model/post.php
    Created migration: APPPATH/migrations/001_create_posts.php
    Created test: APPPATH/tests/model/post.php

Also it can keep the current behavior with receiving this proposal if it was provided --no-test option like --no-migration or a feature to generate a test like oil generate test model:post for only generating test scaffolding. Any thoughts on this please?

Thanks.

WanWizard commented 9 years ago

I would say add a --with-test instead, so default behaviour remains the current behaviour.

watilde commented 9 years ago

@WanWizard Thanks for your comment! --with-test seems good to build it for this version, I'll try to create a pull-request. IMHO, I think that creating test suite automatically as default is a good scaffolding for being curious of test. How about to put to V2? Thanks.

emlynwest commented 9 years ago

@watilde Open a feature request at https://github.com/fuelphp/oil-application as generating tests is something that would be good to include in v2 as well.

watilde commented 9 years ago

@stevewest Thanks for your help Steve. I'll create a feature-request to that repository based on this PR.