Skip to content

Commit

Permalink
test case issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AravindRam-Ranium committed Mar 4, 2024
1 parent 2f96059 commit 1113eee
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/filament-user-consent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
App\Models\EndUser::class,

Check failure on line 13 in config/filament-user-consent.php

View workflow job for this annotation

GitHub Actions / phpstan

Class App\Models\EndUser not found.
],

'auth-guards' => 'web',

'options' => [
'App\Models\Admin' => 'Admin',
'App\Models\Practitioner' => 'Practitioner',
Expand Down
10 changes: 10 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<php>
<env name="APP_KEY" value="base64:NDNkbDNneml1Y2IxbTgwZnFnM3J4b3czMGhrZG0xdXo="/>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
</php>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
Expand Down
3 changes: 1 addition & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
StartSession::class,
VerifyCsrfToken::class,
AuthenticateSession::class,
Authenticate::class,
'auth:admin,practitioner,enduser'
'auth:'.config('filament-user-consent.auth-gurads'),
])->group(function () {
Route::get('consent-option-request', ConsentOptionFormBuilder::class)->name('consent-option-request');
});
2 changes: 2 additions & 0 deletions src/Http/Middleware/ForceRedirectToUnapprovedConsents.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function handle(Request $request, Closure $next)
return $next($request);
}



// Determine if the current route is exempt (a consent route or ends with '.logout')
$route = $request->route()->getName();
$isExemptRoute = str_contains($route, 'consent-options') || str_ends_with($route, '.logout');
Expand Down
1 change: 1 addition & 0 deletions tests/RequestTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Visualbuilder\FilamentUserConsent\Models\ConsentOption;
use Visualbuilder\FilamentUserConsent\Tests\Seeders\ConsentOptionSeeder;

use function Pest\Laravel\get;
Expand Down
29 changes: 29 additions & 0 deletions tests/Seeders/ConsentOptionSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,34 @@ public function run()
</p>',
'is_mandatory' => true,
'is_current' => true,
'additional_info' => true,
'additional_info_title' => "Contract additiona info",
'fields' => [
[
"name" => "name",
"type" => "text",
"label" => "Emergency Contact Name",
"rules" => "",
"options" => "",
"required" => true
],
[
"name" => "position",
"type" => "text",
"label" => "Emergency Contact Position",
"rules" => "",
"options" => "",
"required" => false
],
[
"name" => "phone",
"type" => "text",
"label" => "Emergency Contact Telephone",
"rules" => "",
"options" => "",
"required" => true
]
],
'models' => [
[
'Visualbuilder\FilamentUserConsent\Tests\Models\User' => 'User'
Expand Down Expand Up @@ -152,6 +180,7 @@ public function run()
</ol>',
'is_mandatory' => true,
'is_current' => true,
'additional_info' => false,
'models' => [
[
'Visualbuilder\FilamentUserConsent\Tests\Models\User' => 'User'
Expand Down

0 comments on commit 1113eee

Please sign in to comment.