Skip to content

Commit

Permalink
Regenerated baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Nov 23, 2023
1 parent fbbb64c commit 09ce9d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2701,7 +2701,7 @@ parameters:
path: src/lib/Core/Debug/Shell/Shell.php

-
message: "#^Parameter \\#2 \\$callback of function array_filter expects callable\\(int\\|string\\)\\: mixed, Closure\\(string\\)\\: bool given\\.$#"
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(int\\|string\\)\\: mixed\\)\\|null, Closure\\(string\\)\\: bool given\\.$#"
count: 1
path: src/lib/Core/Debug/Shell/Shell.php

Expand Down
20 changes: 13 additions & 7 deletions src/lib/API/Context/UserContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Ibexa\Behat\API\Facade\UserFacade;
use Ibexa\Behat\Core\Behat\ArgumentParser;
use Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Repository\RoleService;

class UserContext implements Context
{
Expand All @@ -23,13 +22,10 @@ class UserContext implements Context
/** @var \Ibexa\Behat\Core\Behat\ArgumentParser */
private $argumentParser;

private RoleService $roleService;

public function __construct(UserFacade $userFacade, ArgumentParser $argumentParser, RoleService $roleService)
public function __construct(UserFacade $userFacade, ArgumentParser $argumentParser)
{
$this->userFacade = $userFacade;
$this->argumentParser = $argumentParser;
$this->roleService = $roleService;
}

/**
Expand Down Expand Up @@ -65,8 +61,18 @@ public function assignUserToRole(string $userName, string $roleName): void
public function assignUserToRoleIfPossible(string $userName, string $roleIdentifier): void
{
try {
$this->roleService->loadRoleByIdentifier($roleIdentifier);
$this->userFacade->assignUserToRole($userName, $roleIdentifier);
$this->assignUserToRole($userName, $roleIdentifier);
} catch (NotFoundException $e) {
}
}

/**
* @Given I assign user group :userGroupName to role :roleIdentifier if possible
*/
public function assignUserGroupToRoleIfPossible(string $userGroupName, string $roleIdentifier): void
{
try {
$this->assignUserGroupToRole($userGroupName, $roleIdentifier);
} catch (NotFoundException $e) {
}
}
Expand Down

0 comments on commit 09ce9d6

Please sign in to comment.