-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance test coverage & Fix small issues & Refactoring
- Loading branch information
Showing
38 changed files
with
1,274 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,22 @@ | |
namespace Tests\Api\v1\Controllers; | ||
|
||
use App\Api\v1\Controllers\SettingController; | ||
use App\Api\v1\Requests\SettingUpdateRequest; | ||
use App\Facades\Settings; | ||
use App\Models\User; | ||
use Illuminate\Support\Arr; | ||
use Illuminate\Support\Facades\Route; | ||
use Illuminate\Support\Str; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\CoversMethod; | ||
use PHPUnit\Framework\Attributes\Test; | ||
use Tests\FeatureTestCase; | ||
|
||
/** | ||
* SettingController test class | ||
*/ | ||
#[CoversClass(SettingController::class)] | ||
#[CoversMethod(SettingUpdateRequest::class, 'rules')] | ||
class SettingControllerTest extends FeatureTestCase | ||
{ | ||
/** | ||
|
@@ -230,6 +233,16 @@ public function test_update_missing_user_setting_returns_created_setting() | |
]); | ||
} | ||
|
||
#[Test] | ||
public function test_update_restrictList_setting_rejects_invalid_email_list() | ||
{ | ||
$response = $this->actingAs($this->admin, 'api-guard') | ||
->json('PUT', '/api/v1/settings/restrictList', [ | ||
'value' => '[email protected]|janedoeexamplecom', | ||
]) | ||
->assertJsonValidationErrorFor('value'); | ||
} | ||
|
||
#[Test] | ||
public function test_destroy_user_setting_returns_success() | ||
{ | ||
|
Oops, something went wrong.