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 make:posttype to commands #2

Closed
wants to merge 3 commits into from

Conversation

WolfieZero
Copy link
Contributor

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.

@coveralls
Copy link

coveralls commented Jul 12, 2018

Pull Request Test Coverage Report for Build 10

  • 0 of 8 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-8.02%) to 86.17%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Commands/PostTypeMake.php 0 8 0.0%
Totals Coverage Status
Change from base Build 9: -8.02%
Covered Lines: 81
Relevant Lines: 94

💛 - Coveralls

@joelambert
Copy link
Member

Thanks for adding this, can you make a couple of tweaks before we merge it in please:

  • Can you move away from the {{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.
  • We've just added an example test for the 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.

@WolfieZero WolfieZero closed this by deleting the head repository May 19, 2024
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

Successfully merging this pull request may close these issues.

None yet

3 participants