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

A bit confused about the proper use of $context #309

Open
acelaya opened this issue Jul 23, 2021 · 2 comments
Open

A bit confused about the proper use of $context #309

acelaya opened this issue Jul 23, 2021 · 2 comments

Comments

@acelaya
Copy link

acelaya commented Jul 23, 2021

I migrated a couple of months ago to v2 of this library, and the most confusing part was getting my head around the new context concept.

I managed to get it working, thanks to the fact that I have extensive functional and E2E test suites.

However, I find myself in the position of having to apply some changes to the project, due to new requirements, and I'm having a hard time making a proper use of the context in my specifications. Every change I do to fix something, breaks someother use case.

When I did the migration I decided to cut some corners and hardcode some aliases, with the intention to tackle that tech debt later, but it's a bit confusing.

Is there any possibility to have a more extensive documentation that explains how to properly use the context, how it works internally, and what are the implications?

I checked https://github.com/Happyr/Doctrine-Specification/blob/2.x/docs/0-usage.md and https://github.com/Happyr/Doctrine-Specification/blob/2.x/docs/1-creatingSpecs.md, but they don't go into much detail, and assume you know what it is for.

Thanks!

@peter-gribanov
Copy link
Member

Yes. You're right. The documentation is poor at revealing the essence of contexts and how they work. We will try to fix this problem.
Thank you for your comment.

Have you already read the instructions for upgrading to version 2? The instructions mention the use of contexts with examples.

@acelaya
Copy link
Author

acelaya commented Jul 23, 2021

Yes, I checked it back then and it definitely helped. But I admit I didn't remember about it. I'll give it another look.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants