Closed WolfieZero closed 3 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/Commands/PostTypeMake.php | 0 | 8 | 0.0% | ||
<!-- | Total: | 0 | 8 | 0.0% | --> |
Totals | |
---|---|
Change from base Build 9: | -8.02% |
Covered Lines: | 81 |
Relevant Lines: | 94 |
Thanks for adding this, can you make a couple of tweaks before we merge it in please:
{{class_name}}
syntax in the stub. If you can use proper terms e.g. DummyPost
, dummy_post_type
etc it will make it easier for us when we come to refactor all the stub code into something that is more generic/DRY. Effectively if the stub can look like a valid PHP file rather than a Twig template.ControllerMake
command (https://github.com/Rareloop/hatchet/blob/master/tests/Unit/Commands/ControllerMakeTest.php). To try keep a high test coverage as we progress can you write a similar test for your command. You should be able to follow the same pattern but give us a shout if you have any questions. I'd imagine as well as testing the existence of the class you'd also want to assert that the getPostType()
and getPostTypeConfig()
return what you expect.
If you run
php hatchet make:posttype Client
it will generate the a class file for the Client post type.Possible additions to this could be to append the
register
array in config/posttypes.php. Plus, should add some tests.This also adds
doctrine/inflector
to the composer file for naming.