Repository navigation
Scaffold cpt / tax with label - #365
Conversation
There was a problem hiding this comment.
The preg_replace() should go in the extract_args() array above, no?
There was a problem hiding this comment.
Don't really see how that would be implemented, technically :)
The reason I did this is because the $slug is the default value, and the $slug also needs the preg_replace(). So doing this after the whole extract_args part, keeps it down to 1x preg_replace, right?
There was a problem hiding this comment.
The idea is that you should do the preg_replace() only if the slug is used. Since it isn't very expensive, you can just do:
array(
'label' => preg_replace( '/_|-/', ' ', strtolower( $slug ) ),
...
)
There was a problem hiding this comment.
True, because when there is a _ or a - in the --label, it is put there deliberate.
|
Also, where are the functional tests? :D |
|
:) here #366? Not the right command though haha |
|
You could create a new |
|
Cool, but in this pull? On Wed, Mar 27, 2013 at 9:42 PM, Cristi Burcă notifications@github.comwrote:
|
|
Yes, in this pull, because this pull contains the functionality that you're testing. |
There was a problem hiding this comment.
Tags shouldn't contain spaces and should be lowercase, so the correct name would be @custom-post-types.
Also, I'm pretty sure you would have to add it for each scenario.
With that said, I don't really see the usefulness in tags at this point, since tests are already pretty well grouped by file.
There was a problem hiding this comment.
Yeah, I thought that at some point the scaffolding tests would grow and grow because it houses quite some functionality:
- cpt
- tax
- plugin (tests)
- _s theme
So when editing a test, one could filter run the behat test --tag=cpt so it doesnt run all the tests.
Off course, the a final check should be ran on the complete feature. But in development, a tag could come in handy.
Anyway, updated the PR :)
P.s. You're right about the spelling:
http://docs.behat.org/guides/3.hooks.html#tagged-hooks
http://docs.behat.org/guides/6.cli.html#gherkin-filters
There was a problem hiding this comment.
I thought that at some point the scaffolding tests would grow and grow because it houses quite some functionality
That's a good point, but let's cross that bridge when we reach it.
See #364
Have put the label next to the text-domain.