{"id":36993913,"url":"https://github.com/lamoda/codeception-email-mailhog","last_synced_at":"2026-01-13T23:46:07.333Z","repository":{"id":57010979,"uuid":"266861856","full_name":"lamoda/codeception-email-mailhog","owner":"lamoda","description":"PHP library for Codeception","archived":true,"fork":true,"pushed_at":"2021-10-20T08:46:02.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T22:10:59.256Z","etag":null,"topics":["codeception","mailhog","php","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"morismor/codeception-email-mailhog","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamoda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-25T19:19:56.000Z","updated_at":"2023-05-25T09:49:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lamoda/codeception-email-mailhog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lamoda/codeception-email-mailhog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamoda%2Fcodeception-email-mailhog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamoda%2Fcodeception-email-mailhog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamoda%2Fcodeception-email-mailhog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamoda%2Fcodeception-email-mailhog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamoda","download_url":"https://codeload.github.com/lamoda/codeception-email-mailhog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamoda%2Fcodeception-email-mailhog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeception","mailhog","php","testing"],"created_at":"2026-01-13T23:46:07.269Z","updated_at":"2026-01-13T23:46:07.318Z","avatar_url":"https://github.com/lamoda.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MailHog Service Provider for the Codeception Email Testing Framework\n\nThis Codeception Module implements the required methods to test emails using the [Codeception Email Testing Framework][CodeceptionEmailTestingFramework] with [MailHog]\n\n### Installation\nThrough composer, require the package:\n```\n\"require-dev\": {\n    \"lamoda/codeception-email-mailhog\": \"^1.0\"\n}\n```\nThen turn it on in your Codeception suite yaml file\n```\nclass_name: FunctionalTester\nmodules:\n    enabled:\n        - MailHog\n    config:\n        MailHog:\n            url: 'http://mailhog.dev'\n            port: '8025'\n```\nAdditional parameters can be fed directly to the Guzzle connection using the `guzzleRequestOptions` variable.\n\nThe variable `deleteEmailsAfterScenario` can be set to true to ensure that all emails are deleted at the end of each scenario, but it is turned off by default.\n### Added Methods\nThis Module adds a few public methods for the user, such as:\n```\ndeleteAllEmails()\n```\nDeletes all emails in MailHog\n```\nfetchEmails()\n```\nFetches all email headers from MailHog, sorts them by timestamp and assigns them to the current and unread inboxes\n```\naccessInboxFor($address)\n```\nFilters emails to only keep those that are received by the provided address\n```\nopenNextUnreadEmail()\n```\nPops the most recent unread email and assigns it as the email to conduct tests on\n\n### Example Test\nHere is a simple scenario where we test the content of an email.  For a detailed list of all available test methods, please refer to the [Codeception Email Testing Framework][CodeceptionEmailTestingFramework].\n```\n\u003c?php \n$I = new FunctionalTester($scenario);\n$I-\u003eam('a member');\n$I-\u003ewantTo('request a reset password link');\n\n// First, remove all existing emails in the MailHog inbox\n$I-\u003edeleteAllEmails();\n\n// Implementation is up to the user, use this as an example\n$I-\u003erequestAPasswordResetLink();\n\n// Query MailHog and fetch all available emails\n$I-\u003efetchEmails();\n\n// This is optional, but will filter the emails in case you're sending multiple emails or use the BCC field\n$I-\u003eaccessInboxFor('testuser@example.com');\n\n// A new email should be available and it should be unread\n$I-\u003ehaveEmails();\n$I-\u003ehaveUnreadEmails();\n\n// Set the next unread email as the email to perform operations on\n$I-\u003eopenNextUnreadEmail();\n\n// After opening the only available email, the unread inbox should be empty\n$I-\u003edontHaveUnreadEmails();\n\n// Validate the content of the opened email, all of these operations are performed on the same email\n$I-\u003eseeInOpenedEmailSubject('Your Password Reset Link');\n$I-\u003eseeInOpenedEmailBody('Follow this link to reset your password');\n$I-\u003eseeInOpenedEmailRecipients('testuser@example.com');\n```\n\n### License\nCopyright (c) 2015-2016 Eric Martel, http://github.com/ericmartel \u003cemartel@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n   [MailHog]: https://github.com/mailhog/MailHog\n   [CodeceptionEmailTestingFramework]: https://github.com/ericmartel/codeception-email\n   \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamoda%2Fcodeception-email-mailhog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamoda%2Fcodeception-email-mailhog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamoda%2Fcodeception-email-mailhog/lists"}