test: improve services rules validation (#1986)

This commit is contained in:
Alexis Saettler
2018-11-02 16:34:22 +01:00
committed by GitHub
parent 769d795109
commit 444babbb43
53 changed files with 639 additions and 531 deletions
+2 -3
View File
@@ -2,7 +2,6 @@
namespace App\Http\Controllers;
use Exception;
use App\Helpers\DateHelper;
use App\Jobs\ResizeAvatars;
use App\Models\Contact\Tag;
@@ -572,7 +571,7 @@ class ContactsController extends Controller
$state = $request->get('state');
if (auth()->user()->account->hasLimitations()) {
throw new Exception(trans('people.stay_in_touch_premium'));
throw new \LogicException(trans('people.stay_in_touch_premium'));
}
// if not active, set frequency to 0
@@ -582,7 +581,7 @@ class ContactsController extends Controller
$result = $contact->updateStayInTouchFrequency($frequency);
if (! $result) {
throw new Exception(trans('people.stay_in_touch_invalid'));
throw new \LogicException(trans('people.stay_in_touch_invalid'));
}
$contact->setStayInTouchTriggerDate($frequency, DateHelper::getTimezone());