I was trying to reproduce a weird paid in full problem I'm seeing with a custom payment method (Namely that the flag is only executed on the next order save). Wasn't able to trigger that with test code yet but I noticed that there are no tests for the payment API yet, so this should be a start...

CommentFileSizeAuthor
commerce-payment-api-tests.patch4.01 KBberdir

Comments

marcin.wosinek’s picture

Status: Needs review » Reviewed & tested by the community

Looks ok for me.

rszrama’s picture

Status: Reviewed & tested by the community » Needs work

Notice that this was just posted as a start; the tests themselves still have @todos that will need to be completed before we commit this.

berdir’s picture

My own policy for tests is that some tests (assuming they are correct) are better than no tests, tests will never be "complete" anyway. I added the todo more as an idea for further improvements. I have no plans currently to continue working on this, but it might make it easier for someone else to add more payment related tests if the base structure exists.

I figured out my issue by the way, it was a bug in my module :)

So IMHO, this could be commited as it is, you could also remove the @todo or convert it to a normal comment if you don't like having @todo's :)

rszrama’s picture

Ahh, thanks for the clarification. I had assumed from your OP that you meant this to be expanded before committing, so I interpreted the code comments that way. : P

berdir’s picture

Status: Needs work » Reviewed & tested by the community

Setting back to RTBC, as explained, this can be commited IMHO, will hopefully encourage someone to improve it if they don't have to start with nothing.

rszrama’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +low-hanging fruit

Sorry I'm just coming back to this; let's get this in, but we need to update it since the example payment method changed from using the simple "Name" based payment details to simulating credit card payment.