Skip to content

Commit

Permalink
test: update repository tests and remove unnecessary comments
Browse files Browse the repository at this point in the history
- Remove empty comment lines from multiple test files
- Update repository class references in UserLoginLog and UserOperationLog tests
- Add @coversNothing annotation to UserRepositoryTest
- Reorder trait usage in PassportLoginRequest
  • Loading branch information
zds-s committed Oct 23, 2024
1 parent 5619589 commit 9e011a7
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 21 deletions.
3 changes: 2 additions & 1 deletion app/Http/Admin/Request/PassportLoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
])]
class PassportLoginRequest extends FormRequest
{
use ClientIpRequestTrait, ClientOsTrait;
use ClientIpRequestTrait;
use ClientOsTrait;

public function authorize(): bool
{
Expand Down
2 changes: 1 addition & 1 deletion storage/swagger/http.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion tests/Feature/Admin/ControllerCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

/**
* @internal
*
*/
abstract class ControllerCase extends HttpTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class AttachmentControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/PassportControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

/**
* @internal
*
*/
final class PassportControllerTest extends HttpTestCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/Permission/MenuControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

/**
* @internal
*
*/
final class MenuControllerTest extends CrudControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/Permission/RoleControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class RoleControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/Permission/UserControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

/**
* @internal
*
*/
final class UserControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/PermissionControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

/**
* @internal
*
*/
final class PermissionControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/UserLoginLogControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class UserLoginLogControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Admin/UserOperationLogControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class UserOperationLogControllerTest extends ControllerCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Casbin/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

/**
* @internal
*
*/
final class ApiTest extends TestCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Casbin/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

/**
* @internal
*
*/
final class FactoryTest extends TestCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Command/ApplicationInstallCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
#[Group('migrations')]
final class ApplicationInstallCommandTest extends TestCase
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Repository/AttachmentRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class AttachmentRepositoryTest extends AbstractTestRepository
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Repository/MenuRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class MenuRepositoryTest extends AbstractTestRepository
{
Expand Down
1 change: 0 additions & 1 deletion tests/Feature/Repository/RoleRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/**
* @internal
*
*/
final class RoleRepositoryTest extends AbstractTestRepository
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Repository/UserLoginLogRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
namespace HyperfTests\Feature\Repository;

use App\Model\UserLoginLog;
use App\Repository\Logstash\UserLoginLogRepository;
use Carbon\Carbon;
use Hyperf\Collection\Collection;
use Hyperf\DbConnection\Model\Model;
use Hyperf\Stringable\Str;

/**
* @internal
*
*/
final class UserLoginLogRepositoryTest extends AbstractTestRepository
{
Expand All @@ -35,7 +35,7 @@ final class UserLoginLogRepositoryTest extends AbstractTestRepository
* @property Carbon $login_time 登录时间
* @property string $remark 备注
*/
protected string $repositoryClass = \App\Repository\Logstash\UserLoginLogRepository::class;
protected string $repositoryClass = UserLoginLogRepository::class;

protected function getAttributes(): array
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Repository/UserOperationLogRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
namespace HyperfTests\Feature\Repository;

use App\Model\UserOperationLog;
use App\Repository\Logstash\UserOperationLogRepository;
use Faker\Provider\Internet;
use Hyperf\Collection\Collection;
use Hyperf\DbConnection\Model\Model;
use Hyperf\Stringable\Str;

/**
* @internal
*
*/
final class UserOperationLogRepositoryTest extends AbstractTestRepository
{
protected string $repositoryClass = \App\Repository\Logstash\UserOperationLogRepository::class;
protected string $repositoryClass = UserOperationLogRepository::class;

protected function getAttributes(): array
{
Expand Down
1 change: 1 addition & 0 deletions tests/Feature/Repository/UserRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* @internal
* @coversNothing
*/
final class UserRepositoryTest extends AbstractTestRepository
{
Expand Down

0 comments on commit 9e011a7

Please sign in to comment.