public function waitForEmail($timeout = 5)
    {
        $condition = function () {
            return !empty($this->fetchLastMessage());
        };

        $message = sprintf('Waited for %d secs but no email has arrived', $timeout);

        $this->wait($timeout)->until($condition, $message);
    }
public function waitForEmail($timeout = 5)
    {
        $condition = function () {
            return !empty($this->fetchLastMessage());
        };

        $message = sprintf('Waited for %d secs but no email has arrived', $timeout);

        $this->wait($timeout)->until($condition, $message);
    }
public function waitForEmail ( $ timeout = 5 ) { $ condition = function ( ) { return ! empty ( $ this -> fetchLastMessage ( ) ) ; } ; $ message = sprintf ( 'Waited for %d secs but no email has arrived' , $ timeout ) ; $ this -> wait ( $ timeout ) -> until ( $ condition , $ message ) ; }
Wait until an email to be received.

@param int $timeout

@throws \Exception
Wait until an email to be received .