ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble Class Reference
+ Inheritance diagram for ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble:
+ Collaboration diagram for ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble:

Public Member Functions

 __construct (RBAC $rbac, LanguageFolder $language_folder, private readonly bool $throw_type_error=false,)
 
 getDescription ()
 
 getInputDescription (FieldFactory $f)
 
 getOutputDescription (Description\Factory $f)
 
 perform (mixed $parameters)
 This shall perform the activity. More...
 
- Public Member Functions inherited from ILIAS\Language\Activities\LanguageActivity
 __construct (private readonly ?RBAC $rbac, private readonly LanguageFolder $language_folder, protected readonly DataFactory $data=new DataFactory(),)
 
 getType ()
 
 isAllowedToPerform (int $usr_id, mixed $parameters)
 This shall check if the given user is allowed to perform the activity based on business rules of this component. More...
 
 maybePerformAs (InputFactory $input_factory, int $usr_id, array $raw_parameters)
 Grinds the $raw_parameters through the input description, checks if the users is allowed to perform the action as requested and, if so, then attempts to performs it. More...
 
- Public Member Functions inherited from ILIAS\Component\Activities\ActivityImpl
 getName ()
 Shall return classname of the Activity, wrapped in Name. More...
 
 getName ()
 Shall return classname of the Activity, wrapped in Name. More...
 
 getType ()
 
 getDescription ()
 
 getInputDescription (FieldFactory $f)
 
 getOutputDescription (Description\Factory $f)
 
 isAllowedToPerform (int $usr_id, mixed $parameters)
 This shall check if the given user is allowed to perform the activity based on business rules of this component. More...
 
 perform (mixed $parameters)
 This shall perform the activity. More...
 
 maybePerformAs (InputFactory $input_factory, int $usr_id, array $raw_parameters)
 Grinds the $raw_parameters through the input description, checks if the users is allowed to perform the action as requested and, if so, then attempts to performs it. More...
 

Protected Member Functions

 normalizeParameters (array $grind_result)
 
- Protected Member Functions inherited from ILIAS\Language\Activities\LanguageActivity
 overlayWriteFailedOutputField (Description\Factory $f)
 The database was written, but the PO/MO overlay of a module was not: callers must not report plain success. More...
 
 invalidMarkupCustomizingOutputField (Description\Factory $f)
 
 duplicateCustomizingOutputField (Description\Factory $f)
 
 duplicateCustomizingEntries (array $skipped, array $language_keys)
 
 invalidMarkupCustomizingEntries (array $skipped, array $language_keys)
 
 normalizeParameters (array $grind_result)
 

Detailed Description

Definition at line 209 of file LanguageActivityTest.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::__construct ( RBAC  $rbac,
LanguageFolder  $language_folder,
private readonly bool  $throw_type_error = false 
)

Definition at line 211 of file LanguageActivityTest.php.

215 {
216 parent::__construct($rbac, $language_folder);
217 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDescription()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::getDescription ( )

Implements ILIAS\Component\Activities\Activity.

Definition at line 219 of file LanguageActivityTest.php.

219 : Text\SimpleDocumentMarkdown
220 {
221 return $this->data->text()->markdown()->simpleDocument('Test double for LanguageActivity::maybePerformAs().');
222 }

◆ getInputDescription()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::getInputDescription ( FieldFactory  $f)

Implements ILIAS\Component\Activities\Activity.

Definition at line 224 of file LanguageActivityTest.php.

224 : FormInput
225 {
226 if ($this->throw_type_error) {
227 throw new \TypeError('simulated TypeError while building the input description');
228 }
229
230 throw new \RuntimeException('simulated failure while building the input description');
231 }

◆ getOutputDescription()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::getOutputDescription ( Description\Factory  $f)

Implements ILIAS\Component\Activities\Activity.

Definition at line 233 of file LanguageActivityTest.php.

233 : Description\Description
234 {
235 throw new \LogicException(__METHOD__ . ' is not used by this test double.');
236 }

◆ normalizeParameters()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::normalizeParameters ( array  $grind_result)
protected
Returns
array<string, mixed>

Reimplemented from ILIAS\Language\Activities\LanguageActivity.

Definition at line 243 of file LanguageActivityTest.php.

243 : array
244 {
245 throw new \LogicException(__METHOD__ . ' is not used by this test double.');
246 }

◆ perform()

ILIAS\Language\Tests\Activities\LanguageActivityThrowingInputDescriptionTestDouble::perform ( mixed  $parameters)

This shall perform the activity.

This shall not check if a user is allowed to perform the activity. The returned data should match the Description given by getOutputDescription.

Exceptions
anySPL Exception (https://www.php.net/manual/en/spl.exceptions.php)
Parameters
mixed$parameterswhatever the FormInput from getInputDescription produces.

Implements ILIAS\Component\Activities\Activity.

Definition at line 238 of file LanguageActivityTest.php.

238 : mixed
239 {
240 throw new \LogicException(__METHOD__ . ' is not used by this test double.');
241 }

The documentation for this class was generated from the following file: