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
Provides art command #1191
Provides art command #1191
Conversation
@dustinleblanc, thanks for your PR! By analyzing the blame information on this pull request, we identified @greg-1-anderson, @TeslaDethray and @bensheldon to be potential reviewers |
cc5efab
to
b3d200c
Compare
@@ -28,8 +28,7 @@ | |||
$container = new Container(); | |||
$input = new ArgvInput($_SERVER['argv']); | |||
$output = new ConsoleOutput(); | |||
$roboConfig = new \Robo\Config(); // TODO: make Terminus Config extend \Robo\Config and use $config here | |||
Robo::configureContainer($container, $roboConfig, $input, $output, $application); | |||
Robo::configureContainer($container, $config, $input, $output, $application); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I forgot to do this in my previous PR. Good catch.
@dustinleblanc Please open a separate PR for the change to |
Done, see #1192 |
I <3 |
Thank you for doing that so promptly, @dustinleblanc. I didn't realize that your base branch is out-of-date, though. |
shouldn't be, it was rebased, and the current version still looks to be injecting |
b3d200c
to
752cbdf
Compare
@TeslaDethray 👍 I'll rebase this, get testing finished, and re-submit |
752cbdf
to
34a293f
Compare
@@ -24,7 +24,8 @@ | |||
"autoload": { | |||
"psr-4": { | |||
"Terminus\\": ["php/", "php/Terminus/"], | |||
"Pantheon\\Terminus\\": "src/" | |||
"Pantheon\\Terminus\\": "src/", | |||
"Pantheon\\Terminus\\Tests\\": "tests/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually prefer to make this tests/src
so that your test classes are not mixed in with your other testing files. Individual project variation is fine here, though -- up to @TeslaDethray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I'm actually rebasing to cleanup right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading further, it seems you only added this for Um, mistake, sorry, that's wrong. This is necessary.tests/CommandTestCase.php
. It should not be necessary to add an entry to the autoloader for this file (which I do think belongs immediately inside tests
), as phpunit should already be loading it.
When adding tests
directory to the autoloader, you should put them in autoload-dev
rather than autoload
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, misread your code the first time. Corrected my comment, you were right. Just move the directive to autoload-dev and it's perfect.
Great work -- love the test class! |
52d9ccf
to
c701a8f
Compare
Thanks! I'm hoping it makes it easier for us to run faster tests that can load up a whole command, tip to tail and assert against it easily. |
1 similar comment
c701a8f
to
2faaf27
Compare
@TeslaDethray @greg-1-anderson Something that just occurred to me, though PHPUnit is running these, and they are good n snappy, they are functional tests rather than true unit tests. Should they be separated? |
@dustinleblanc I was hoping that the protected functions, retrieveArt and and validate asset, would be tested individually, like @ajbarry has done in the connection:info PR. |
@TeslaDethray sure! That will certainly increase our test coverage :) |
I often use phpunit to write functional tests. I don't always separate these from unit tests, although some projects do. If separated, all of the tests should run in a single execution of phpunit, so that our test coverage can be calculated accurately. |
@TeslaDethray oh yeah, I just realized that will require the reflection dance...I'll back burner it for now and perhaps wait for that to settle and just integrate whatever helpers come out of that if we do indeed want to test protected/private members. |
I think the general procedure should be:
Avoid 2. and 3. unless necessary. |
@TeslaDethray so our approach to the functional tests is asserting on the
vcr replay, is that correct?
|
2faaf27
to
d5e986d
Compare
d5e986d
to
3e47e37
Compare
2 similar comments
Good work! I'm merging this in to build on. |
Still need to write proper test cases. but the change to the ./bin/terminus.php is pretty important, so we may want to get this merged.
to use the art command, just run
./bin/terminus.php art rocket
and enjoy