- Notifications
You must be signed in to change notification settings - Fork 23
New functionality to search for specific email and to delete and email #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
$this->cleanInbox(); | ||
} | ||
*/ |
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?
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.
Agreed with @sergeyklay, the cleanup functionality is useful when running test in some cases, you can always deactivate it from the config.
$attachments = $this->fetchAttachmentsOfLastMessage(); | ||
| ||
$this->assertEquals($bool, count($attachments) > 0); | ||
} |
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?
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.
Agreed with @sergeyklay, no need to delete method because they seem related to the feature you are trying to add.
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.
Thank you for your contribution. I left a few comments on the revisions needed. Avoid deleting previous method to avoid unnecessary breaking changes. Also, a thorough description of the added functionality on the PR would be appreciated.
} | ||
$this->cleanInbox(); | ||
} | ||
*/ |
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.
Agreed with @sergeyklay, the cleanup functionality is useful when running test in some cases, you can always deactivate it from the config.
$testEmailAddress = $this->config['testEmailAddress']; | ||
| ||
return $testEmailAddress; | ||
} |
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.
Providing a default in the config would be preferred. Also, the use of a temporary variable is not necessary here and could be avoided:
public function getTestEmailAddress() { return $this->config['testEmailAddress']; }
$messages = json_decode($messages, true); | ||
} while ($counter < 60 && $messages == Null); | ||
} | ||
return array_shift($messages); |
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.
The method searchForMessage()
could be added in addition with the fetchLastMessage
method, no need to get rid of it.
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.
Also:
- the
else
statement could be avoided - the InboxID parameter should be optional, since it will default to the one in the config
- emails are usually received by mailtrap pretty fast, not sure doing 60 attempts is necessary
- the use of
sleep()
andecho
is not recommended, nor necessary.
} | ||
return array_shift($messages); | ||
} | ||
|
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.
- The else statement could be avoided here as well
- The
$inboxID
should be the second parameter and optional as it will default to the config.
$messages = $this->client->delete("inboxes/{$this->config['inbox_id']}/messages/".$messageID); | ||
} | ||
} | ||
|
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.
- Make $inboxID optional
- Else statement unnecessary.
$attachments = $this->fetchAttachmentsOfLastMessage(); | ||
| ||
$this->assertEquals($bool, count($attachments) > 0); | ||
} |
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.
Agreed with @sergeyklay, no need to delete method because they seem related to the feature you are trying to add.
No description provided.