-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ibx-1481_added_field_group_limitation_parser (#241)
added hasClass assert to ElementAssert added additional hasClass configuration fixed hasClass assert message
- Loading branch information
1 parent
c4d61c1
commit 45c1081
Showing
6 changed files
with
61 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
src/lib/API/Context/LimitationParser/FieldGroupLimitationParser.php
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace EzSystems\Behat\API\Context\LimitationParser; | ||
|
||
use eZ\Publish\API\Repository\Values\User\Limitation; | ||
use Ibexa\Platform\Contracts\Permissions\Repository\Values\User\Limitation\FieldGroupLimitation; | ||
|
||
class FieldGroupLimitationParser implements LimitationParserInterface | ||
{ | ||
public function supports(string $limitationType): bool | ||
{ | ||
return \in_array(strtolower($limitationType), ['fieldgroup', 'field group']); | ||
} | ||
|
||
public function parse(string $limitationValues): Limitation | ||
{ | ||
$limitations = explode(',', $limitationValues); | ||
|
||
return new FieldGroupLimitation( | ||
['limitationValues' => $limitations] | ||
); | ||
} | ||
} |
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