Skip to content

Commit 8f66c0c

Browse files
committed
fix tests
1 parent 1a9cca5 commit 8f66c0c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/Http/Controllers/Auth/ApplicationController.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Http\Controllers\Auth;
44

55
use App\Exports\ApplicantsExport;
6+
use App\Models\Application;
67
use App\Models\ApplicationForm;
78
use App\Models\Faculty;
89
use App\Models\File;
@@ -12,6 +13,7 @@
1213
use App\Models\Semester;
1314
use App\Models\User;
1415
use App\Models\Workshop;
16+
use App\Utils\ApplicationHandler;
1517
use App\Utils\PeriodicEventController;
1618
use Carbon\Carbon;
1719
use Illuminate\Auth\Access\AuthorizationException;
@@ -28,6 +30,8 @@
2830
*/
2931
class ApplicationController extends PeriodicEventController
3032
{
33+
use ApplicationHandler;
34+
3135
private const EDUCATIONAL_ROUTE = 'educational';
3236
private const QUESTIONS_ROUTE = 'questions';
3337
private const FILES_ROUTE = 'files';
@@ -45,7 +49,7 @@ public function __construct()
4549
*/
4650
public function updateApplicationPeriod(Request $request): RedirectResponse
4751
{
48-
$this->authorize('finalize', ApplicationForm::class);
52+
$this->authorize('finalize', Application::class);
4953

5054
$request->validate([
5155
'semester_id' => 'required|exists:semesters,id',
@@ -108,7 +112,6 @@ public function show(Request $request): View|RedirectResponse
108112
/**
109113
* @param Request $request
110114
* @return RedirectResponse
111-
* @throws AuthenticationException
112115
*/
113116
public function store(Request $request): RedirectResponse
114117
{

tests/Feature/AdmissionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function setUp(): void
3636
parent::setUp();
3737
//open application period
3838
PeriodicEvent::create([
39-
'event_model' => ApplicationController::class,
39+
'event_name' => PeriodicEvent::APPLICATION_PERIOD,
4040
'start_date' => now()->subWeeks(2),
4141
'end_date' => now()->subDay(),
4242
'semester_id' => Semester::current()->id

0 commit comments

Comments
 (0)