What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello and good morning everyone, I've got a question regarding testing: I want to test some function

U01660GHSTT
U01660GHSTT Posts: 80 🧑🏻‍🚀 - Cadet

Hello and good morning everyone,
I've got a question regarding testing: I want to test some functionality in our payment provider's module. To do so I need to "mock" an order. I've learnt that "Transfers" in the _data directory are meant to solve this problem. My question is: Should I create an "Orer transfer mock" in the payment provider's module or is it a better practice to create the mock in the order module an inject it to the pp-module?

Comments

  • Hey Marcel! You can use SalesDataHelper to create an order in test env and then find it by id.
    Please check this out \SprykerTest\Shared\Sales\Helper\SalesDataHelper::haveOrder

  • U01660GHSTT
    U01660GHSTT Posts: 80 🧑🏻‍🚀 - Cadet

    Thank you very much