Skip to content

Conversation

rmacdon465
Copy link

No description provided.

}
$this->cleanInbox();
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member

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);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Member

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.

Copy link
Member

@foxted foxted left a 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();
}
*/
Copy link
Member

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;
}
Copy link
Member

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);
Copy link
Member

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.

Copy link
Member

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() and echo is not recommended, nor necessary.
}
return array_shift($messages);
}

Copy link
Member

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);
}
}

Copy link
Member

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);
}
Copy link
Member

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.

@foxted foxted closed this Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants