public static function setUpBeforeClass() { $server = new Server('imap.gmail.com'); if (false === \getenv('EMAIL_USERNAME')) { throw new \RuntimeException('Please set environment variable EMAIL_USERNAME before running functional tests'); } if (false === \getenv('EMAIL_PASSWORD')) { throw new \RuntimeException('Please set environment variable EMAIL_PASSWORD before running functional tests'); } static::$connection = $server->authenticate(\getenv('EMAIL_USERNAME'), \getenv('EMAIL_PASSWORD')); }
/** * @expectedException \Shapecode\Imap\Exception\AuthenticationFailedException */ public function testFailedAuthenticate() { $server = new Server('imap.gmail.com'); $server->authenticate('fake_username', 'fake_password'); }