Skip to content

Commit

Permalink
magento/magento2#: GraphQL. Mutation: sendEmailToFriend. Test coverag…
Browse files Browse the repository at this point in the history
…e for “Please provide Email of sender.”
  • Loading branch information
atwixfirster committed Apr 29, 2020
1 parent bb7e08f commit bac11ae
Showing 1 changed file with 106 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,81 +287,124 @@ public function testSendProductWithoutVisibility()
/**
* @return array
*/
public function sendFriendsErrorsDataProvider()
public function sendFriendsErrorsDataProvider(): array
{
return array_merge(
$this->getRecipientErrors(),
$this->getSenderErrors()
);
}

/**
* @return array
*/
private function getRecipientErrors(): array
{
return [
[
'product_id: 1
sender: {
name: "Name"
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: ""
email:"recipient1@mail.com"
},
{
name: ""
email:"recipient2@mail.com"
}
]', 'Please provide Name for all of recipients.'
'product_id: 1
sender: {
name: "Name"
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: ""
email:"recipient1@mail.com"
},
{
name: ""
email:"recipient2@mail.com"
}
]',
'Please provide Name for all of recipients.'
],
[
'product_id: 1
sender: {
name: "Name"
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: "Recipient Name 1"
email:""
},
{
name: "Recipient Name 2"
email:""
}
]', 'Please provide Email for all of recipients.'
sender: {
name: "Name"
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: "Recipient Name 1"
email:""
},
{
name: "Recipient Name 2"
email:""
}
]',
'Please provide Email for all of recipients.'
],
];
}

/**
* @return array
*/
private function getSenderErrors(): array
{
return [
[
'product_id: 1
sender: {
name: ""
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: "Recipient Name 1"
email:"recipient1@mail.com"
},
{
name: "Recipient Name 2"
email:"recipient2@mail.com"
}
]', 'Please provide Name of sender.'
sender: {
name: ""
email: "e@mail.com"
message: "Lorem Ipsum"
}
recipients: [
{
name: "Recipient Name 1"
email:"recipient1@mail.com"
},
{
name: "Recipient Name 2"
email:"recipient2@mail.com"
}
]',
'Please provide Name of sender.'
],
[
'product_id: 1
sender: {
name: "Name"
email: "e@mail.com"
message: ""
}
recipients: [
{
name: "Recipient Name 1"
email:"recipient1@mail.com"
},
{
name: "Recipient Name 2"
email:"recipient2@mail.com"
}
]', 'Please provide Message.'
]
sender: {
name: "Name"
email: ""
message: "Lorem Ipsum"
}
recipients: [
{
name: "Recipient Name 1"
email:"recipient1@mail.com"
},
{
name: "Recipient Name 2"
email:"recipient2@mail.com"
}
]',
'Please provide Email of sender.'
],
[
'product_id: 1
sender: {
name: "Name"
email: "e@mail.com"
message: ""
}
recipients: [
{
name: "Recipient Name 1"
email:"recipient1@mail.com"
},
{
name: "Recipient Name 2"
email:"recipient2@mail.com"
}
]',
'Please provide Message.'
],
];
}

Expand Down

0 comments on commit bac11ae

Please sign in to comment.