-
Notifications
You must be signed in to change notification settings - Fork 153
[263] API-functional tests #264
[263] API-functional tests #264
Conversation
email: "[email protected]" | ||
message: "Lorem Ipsum" | ||
} | ||
recipients: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like two elements of recipients will be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
It's ok
Check app/code/Magento/SendFriend/etc/config.xml:15
use Magento\Catalog\Api\Data\ProductTierPriceExtensionFactory; | ||
use Magento\Catalog\Api\Data\ProductExtensionInterfaceFactory; | ||
|
||
\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to have this fixture if we already have same fixture in Magento code base?
$this->expectException(\Exception::class); | ||
$this->expectExceptionMessage("You can't send messages more than {$sendFriend->getMaxSendsToFriend()} times an hour."); | ||
|
||
for ($i = 0; $i <= $sendFriend->getMaxSendsToFriend() + 1; $i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if value will be 10000
we will have huge cycle in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear so far how this 10000
can appear :).
*/ | ||
private $dataObjectFactory; | ||
|
||
protected function setUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls, remove unused properties
/** | ||
* @magentoApiDataFixture Magento/SendFriend/_files/product_simple.php | ||
*/ | ||
public function testSendWithoutRecipentsName() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like for validation w can use dataProviders
instead of creating separate methods
|
||
/** | ||
* @magentoApiDataFixture Magento/SendFriend/_files/product_simple.php | ||
* @magentoApiDataFixture Magento/SendFriend/Fixtures/sendfriend_configuration.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, we should use the approach described in https://github.com/magento/graphql-ce/issues/167
Pls, link this temporal solution with the #167
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand I can skip this comment. Just leave todo.
Hello @VoronoyAlexandr, Please let me know if you need any assistance. |
Hi |
Hi @VoronoyAlexandr, thank you for your contribution! |
Description (*)
This PR add API-function tests which cover negative scenarios
Fixed Issues (if relevant)
Contribution checklist (*)