Allow negative price for custom option: fixes #7333 in GitHub (internal MAGETWO-60573)#13393
Allow negative price for custom option: fixes #7333 in GitHub (internal MAGETWO-60573)#13393luckyduck wants to merge 7 commits intomagento:2.2-developfrom
Conversation
|
|
|
Just signed the CLA (and added the mail address to my github account as well) |
| $valueMock->expects($this->any())->method('getType')->will($this->returnValue($type)); | ||
| $valueMock->expects($this->once())->method('getPriceType')->will($this->returnValue($priceType)); | ||
| $valueMock->expects($this->once())->method('getPrice')->will($this->returnValue($price)); | ||
| $valueMock->expects($this->never())->method('getPrice')->will($this->returnValue($price)); |
There was a problem hiding this comment.
If the method should never be called, the will is not necessary (and will probably confuse the reader).
| $valueMock->expects($this->exactly(2))->method('getType')->will($this->returnValue($type)); | ||
| $valueMock->expects($this->once())->method('getPriceType')->will($this->returnValue($priceType)); | ||
| $valueMock->expects($this->once())->method('getPrice')->will($this->returnValue($price)); | ||
| $valueMock->expects($this->never())->method('getPrice')->will($this->returnValue($price)); |
| $this->assertFalse($this->validator->isValid($valueMock)); | ||
| $this->assertEquals($messages, $this->validator->getMessages()); | ||
| $this->assertTrue($this->validator->isValid($valueMock)); | ||
| $this->assertNotEquals($messages, $this->validator->getMessages()); |
There was a problem hiding this comment.
I propose making the check more specific, i.e., to check for the expected messages instead.
There was a problem hiding this comment.
Thank you so much for your feedback! Will make the proposed changes and improve the tests.
…nvalid price types fail. Also makes sure price is not relevant for validation (assert that getPrice is not called)
|
Updated tests, to reflect the new situation:
|
|
Hi @luckyduck could you take a look at the merge conflict for me please, then I can process this PR. |
|
Oh, of course. Can you give me a hint, how best to do this? |
|
I would recommend updating your main First you need to add a new remote. Then when you are checked out on your feature branch you can rebase on the upstream/2.2-develop branch rather than the origin/2.2-develop branch.
It will then ask you which commits you would like and it will also ask you to fix any conflicts that you come across. |
|
Hi @luckyduck thank you for this PR. I am currently doing a couple of things.
I will update you via this PR once I have some more information. Thank you for your patience. |
|
Hi @luckyduck thank you for your pull request. I am closing this pull request as it has been covered by #15267. |
Description
The price for custom options should be allowed to be negative. The contained changes do just that. In addition, a cosmetic problem is solved. Once options are allowed to be negative, available options (in a drop-down) add a plus sign as prefix to the price, resulting in '+-1,50 €" for a negative option price (-1,50 in this example). This is fixed as well.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist