Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
berkut1 committed Jun 11, 2024
1 parent 998b506 commit 52d8270
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
- ./:/app
# - vendor:/app/vendor
environment:
PHP_IDE_CONFIG: "serverName=Docker"
PHP_IDE_CONFIG: "serverName=DockerTest"
depends_on:
- scpsc-postgres
scpsc-php-cli:
Expand All @@ -31,7 +31,7 @@ services:
- composer:/root/.composer/cache
# - vendor:/app/vendor
environment:
PHP_IDE_CONFIG: "serverName=Docker"
PHP_IDE_CONFIG: "serverName=DockerTest"
depends_on:
- scpsc-postgres
# scpsc-node:
Expand Down
6 changes: 5 additions & 1 deletion src/Model/User/UseCase/Create/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ public function handle(Command $command): void
$command->login,
$hash,
);
$user->changeRole(new Role($command->role));

$role = new Role($command->role);
if(!$role->isUser()){
$user->changeRole(new Role($command->role));
}

$this->users->add($user);

Expand Down
6 changes: 5 additions & 1 deletion src/Model/User/UseCase/SignUp/Manual/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public function handle(Command $command): void
$command->login,
$hash,
);
$user->changeRole(new Role($command->role));

$role = new Role($command->role);
if(!$role->isUser()){
$user->changeRole(new Role($command->role));
}

$this->users->add($user);

Expand Down

0 comments on commit 52d8270

Please sign in to comment.