public static function createOrThrowException(array $notifiers = []) { if (empty($notifiers)) { $notifiers = static::getDefaultNotifiers(); } $bestNotifier = self::chooseBestNotifier($notifiers); if (null === $bestNotifier) { throw new NoSupportedNotifierException(); } return $bestNotifier; }
/** @expectedException \Joli\JoliNotif\Exception\NoSupportedNotifierException */ public function testCreateOrThrowExceptionWithNoSupportedNotifiersThrowsException() { NotifierFactory::createOrThrowException([new ConfigurableNotifier(false), new ConfigurableNotifier(false)]); }