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

Create a test kit #66

Open
Neirda24 opened this issue Jun 10, 2024 · 4 comments
Open

Create a test kit #66

Neirda24 opened this issue Jun 10, 2024 · 4 comments

Comments

@Neirda24
Copy link
Contributor

The goal is to be able to easily mock / test any application using this bundle without having to mock everything ourselves.

@smnandre
Copy link
Contributor

Do you have any spec/draft/shopping list about this?

We may need something similar soonish at work 👼

@Neirda24
Copy link
Contributor Author

  • A way to easily test custom builder
  • a simple MockGotenbergClient similar to HttpClient one where I can provide a path to a hard coded file.
  • Maybe some custom Assert $this->assertSensioLabsGotenbergGeneratedPdfCount(xxx), $this->assertSensioLabsGotenbergGeneratedFileMatches('/path/to/test-file')

WDYT ?

@smnandre
Copy link
Contributor

I think both are great idea... priority would depend on your short-term goals:

  • more "users" --> let's start with MockClient, and Assert then if possible
  • more implementations / builder / processors -> BuilderTestCase

Clearly, having a MockGotenberg would add great value to the project DX.

@Jean-Beru
Copy link
Contributor

  • a simple MockGotenbergClient similar to HttpClient one where I can provide a path to a hard coded file.

Maybe something similar to https://github.com/sensiolabs/GotenbergBundle/pull/118/files#diff-39ed97fae618725a167e6c6cf5924d99853127dcc4fde373a28e9e4493a96a73R1 ? It could allow to mock and make some assertions.

Maybe some custom Assert $this->assertSensioLabsGotenbergGeneratedPdfCount(xxx), $this->assertSensioLabsGotenbergGeneratedFileMatches('/path/to/test-file')

Like Mailer and Messenger. We could use the existing DataCollector or throw some Events (DataCollector could also use them)

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

No branches or pull requests

3 participants