Download the PHP package jtproductions/mailtrap-assertions without Composer

On this page you can find all versions of the php package jtproductions/mailtrap-assertions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mailtrap-assertions

Mailtrap assertsions to use in phpunit tests

The mailtrap assertiosn is to TDD your Laravel Application to check if mails has been send to mailtrap.

Installation

You can install the package using

.env file

You need to add a few variables into your .env file. You need to firstly login to your mailtrap.io account.

MAILTRAP_API_KEY => In the left navigation bar you click on API. There you see your API Token which you copy and paste in your .env file

MAILTRAP_INBOX_ID => In the left navigation bar you click on inboxes and then click on the name of your inbox. Now you see in the address bar something like https://mailtrap.io/inboxes/123456789/messages. The number between inboxes and messages is your inbox ID. In this case it is 123456789.

tests/TestCase.php

In your tests directory you open up TestCase.php and add make sure you have the following code

phpunit.xml

Open up your phpunit.xml file. Change MAIL_MAILER from array to smtp

Usage

Adding traits

The trait RefreshMailtrap will empty you mailbox on each

All the assertions are in the MailtrapAssertions Trait

Assert empty mailbox

To check if the mailbox is empty

Assert mailbox has $count messages

This asserts that there are 3 messages in the mailbox

Manual clean mailbox

If you don't want to use the RefreshMailtrap trait or during a test clean your mailbox


All versions of mailtrap-assertions with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.2
php Version ^7.3
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jtproductions/mailtrap-assertions contains the following files

Loading the files please wait ....