-
-
Notifications
You must be signed in to change notification settings - Fork 420
Add a new make:test command #807
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
Conversation
6a7cef0
to
2f748c3
Compare
src/DependencyInjection/CompilerPass/MakeCommandRegistrationPass.php
Outdated
Show resolved
Hide resolved
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator) | ||
{ | ||
$testClassNameDetails = $generator->createClassNameDetails( | ||
$input->getArgument('name'), |
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.
Do we ever ask this interactively?
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.
Yes, it's delegated to the method in the abstract class.
class MakeFunctionalTestTest extends MakerTestCase | ||
{ | ||
public function getTestDetails() | ||
{ | ||
yield 'functional_maker' => [MakerTestDetails::createTest( |
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.
This test is failing because of a bug in MakerTestCase
. If a previous test (such as our new MakeTestTest
) installs Panther, then the autoloader is confused for some reason and detects the dependency has always available even if it isn't, so the generated test extends PantherTestCase
instead of WebTestCase
. But when the test is executed in isolation, this time PantherTestCase
isn't available, and it fails.
As this class is now deprecated, I don't think that it is worth it to fix MakerTestCase
.
6c3e88d
to
db16346
Compare
Thanks Kévin! |
Replaces #806.
As a result of discussions with @weaverryan, this PR introduces a new generic test maker. It allows creating unit (PHPUnit), integration/service (WebTestCase) and E2E/UI (PantherTestCase) tests.
make:unit-test
andmake:functional-test
have been deprecated, but BC is preserved.