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

[tests] test bundle against actual symfony app #319

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

jrushlow
Copy link
Collaborator

@jrushlow jrushlow commented May 17, 2024

  • allows us to test the bundle in a Symfony "web app"
  • borrows concepts from MakerBundle. One day we'll also test against the generated output of make:reset-password instead of using fixtures.
  • later, we'll improve caching of the "app" so it can be reused for multiple tests. This isn't being done now as there are more pressing issues at hand...
  • the fixtures included were generated by make:reset-password with slight modifications

@jrushlow jrushlow added the Minor Minor Enhancement label May 17, 2024
Copy link
Member

@bocharsky-bw bocharsky-bw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! The only concern is about keeping this test code in fixtures with the latest changes in recipes in sync.

@jrushlow
Copy link
Collaborator Author

jrushlow commented Jun 6, 2024

The only concern is about keeping this test code in fixtures with the latest changes in recipes in sync.

Agree'd - ideally we'd run make:reset-password when bootstrapping the test. But, make:reset-password requires user input. The only way to do that programmatically is via stream - like we do in MakerBundle https://github.com/symfony/maker-bundle/blob/main/src/Test/MakerTestEnvironment.php#L333

We could re-create that code here in reset-password, but I think a better option would be to create some sort of test-helpers repo that has all of that included -> then use that here to call make:reset-password. This will also be needed in VerifyEmailBundle to do "app" testing against make:registration.

I'm going to create an issue for visibility, and merge this for the time being. But ultimately yes, I manually updating fixtures is not a good solution in the log term..

@jrushlow jrushlow merged commit b64c0bb into SymfonyCasts:main Jun 6, 2024
8 checks passed
@jrushlow jrushlow deleted the tests/app-test branch June 6, 2024 13:50
jrushlow added a commit to jrushlow/reset-password-bundle that referenced this pull request Jun 6, 2024
* main:
  minor SymfonyCasts#319 [tests] test bundle against actual symfony app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor Minor Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants