PHP code example of jtproductions / mailtrap-assertions

1. Go to this page and download the library: Download jtproductions/mailtrap-assertions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jtproductions / mailtrap-assertions example snippets


protected function setUpTraits()
{
    $uses = parent::setUpTraits(); // TODO: Change the autogenerated stub

    if (isset($uses[RefreshMailtrap::class])) {
        $this->refreshMailtrap();
    }

    if (isset($uses[MailtrapAssertions::class])) {
        $this->mailtrapSetup();
    }
}
 
class ExampleTest extends TestCase
{
    use RefreshMailtrap;    
}

class ExampleTest extends TestCase
{
    use MailtrapAssertions;    
}

$this->assertMailboxEmpty();

$this->assertMailboxCount(3);

$this->emptyMailbox();