ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceBaseTest Class Reference

Class ilTermsOfServiceBaseTest. More...

+ Inheritance diagram for ilTermsOfServiceBaseTest:
+ Collaboration diagram for ilTermsOfServiceBaseTest:

Protected Member Functions

 setUp ()
 
 getLanguageMock ()
 
 setGlobalVariable (string $name, $value)
 
 assertException (string $exceptionClass)
 
 getCriterionConfig ($value=null)
 

Protected Attributes

 $dic
 

Detailed Description

Member Function Documentation

◆ assertException()

ilTermsOfServiceBaseTest::assertException ( string  $exceptionClass)
protected
Parameters
string$exceptionClass

Definition at line 69 of file ilTermsOfServiceBaseTest.php.

Referenced by ilTermsOfServiceAcceptanceHistoryGUITest\testAccessDeniedErrorIsRaisedWhenPermissionsAreMissing(), ilTermsOfServiceDocumentGUITest\testAccessDeniedErrorIsRaisedWhenPermissionsAreMissing(), ilTermsOfServiceDocumentEvaluationTest\testExceptionIsRaisedIfADocumentIsRequestedFromEvaluatorAndNoDocumentExistsAtAll(), ilTermsOfServiceCriterionTypeFactoryTest\testExceptionIsRaisedIfUnsupportedCriterionIsRequested(), ilTermsOfServiceTableDataProviderFactoryTest\testExceptionIsRaisedWhenAcceptanceHistoryProviderIsRequestedWithoutCompleteFactoryConfiguration(), ilTermsOfServiceAcceptanceHistoryCriteriaBagTest\testExceptionIsRaisedWhenAtLeastOneInvalidElementIsPassedOnJsonStringImport(), ilTermsOfServiceAcceptanceHistoryCriteriaBagTest\testExceptionIsRaisedWhenAtLeastOneNonCriterionIsPassedInArrayOnCreation(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenAttachingDuplicateCriteria(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenAttachingDuplicateCriteriaEvenWithDifferentIds(), ilTermsOfServiceDataGatewayFactoryTest\testExceptionIsRaisedWhenGatewayIsRequestedWithMissingDependencies(), ilTermsOfServiceAcceptanceHistoryCriteriaBagTest\testExceptionIsRaisedWhenInvalidJsonDataIsPassedOnImport(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenRemovingUnknownCriterion(), ilTermsOfServiceDataGatewayFactoryTest\testExceptionIsRaisedWhenUnknownDataGatewayIsRequested(), ilTermsOfServiceEntityFactoryTest\testExceptionIsRaisedWhenUnknownEntityIsRequested(), and ilTermsOfServiceTableDataProviderFactoryTest\testExceptionIsRaisedWhenUnsupportedProviderIsRequested().

70  {
71  if (version_compare(\PHPUnit_Runner_Version::id(), '5.0', '>=')) {
72  $this->setExpectedException($exceptionClass);
73  }
74  }
+ Here is the caller graph for this function:

◆ getCriterionConfig()

ilTermsOfServiceBaseTest::getCriterionConfig (   $value = null)
protected
Parameters
mixed$value
Returns

Definition at line 80 of file ilTermsOfServiceBaseTest.php.

Referenced by ilTermsOfServiceNullCriterionTest\buildForm(), ilTermsOfServiceUserHasLanguageCriterionTest\buildForm(), ilTermsOfServiceDocumentTest\criteriaAssignmentProvider(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\criteriaAssignmentProvider(), ilTermsOfServiceUserHasLanguageCriterionTest\failingConfigProvider(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\failingConfigProvider(), ilTermsOfServiceUserHasLanguageCriterionTest\languageProvider(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\objectCacheProvider(), ilTermsOfServiceUserHasLanguageCriterionTest\succeedingConfigProvider(), ilTermsOfServiceNullCriterionTest\testCriterionAlwaysCreateEmptyConfigValue(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testCriterionWithSameNatureIsNotAcceptedWhenAlreadyAssigned(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenAttachingDuplicateCriteria(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenAttachingDuplicateCriteriaEvenWithDifferentIds(), ilTermsOfServiceDocumentTest\testExceptionIsRaisedWhenRemovingUnknownCriterion(), ilTermsOfServiceNullCriterionTest\testTypeIdentPresentatioEqualsANonEmptyString(), ilTermsOfServiceUserHasLanguageCriterionTest\testValuesFromFormUserInterfaceElementsCanBeRetrieved(), and ilTermsOfServiceUserHasGlobalRoleCriterionTest\testValuesFromFormUserInterfaceElementsCanBeRetrieved().

81  {
82  if (null === $value) {
83  return new \ilTermsOfServiceCriterionConfig();
84  }
85 
86  return new \ilTermsOfServiceCriterionConfig($value);
87  }
Class ilTermsOfServiceCriterionConfig.
+ Here is the caller graph for this function:

◆ getLanguageMock()

ilTermsOfServiceBaseTest::getLanguageMock ( )
protected
Returns
PHPUnit_Framework_MockObject_MockObject|

Definition at line 39 of file ilTermsOfServiceBaseTest.php.

References $lng.

Referenced by ilTermsOfServiceUserHasLanguageCriterionTest\languageProvider(), ilTermsOfServiceNullCriterionTest\setUp(), setUp(), ilTermsOfServiceUserHasLanguageCriterionTest\setUp(), ilTermsOfServiceUserHasGlobalRoleCriterionTest\setUp(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintAcceptanceWorksAsExpected(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintCheckWorksAsExpected(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintExposesCorrectErrorMessagesAfterMultiAccept(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintProblemBuilderWorksAsExpected(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintProblemDetectionWorksAsExpected(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testConstraintRestrictionWorksAsExpected(), ilTermsOfServiceDocumentCriterionAssignmentConstraintTest\testCriterionWithSameNatureIsNotAcceptedWhenAlreadyAssigned(), ilTermsOfServiceSettingsFormGUITest\testFormCannotBeSavedWithEnabledServiceWhenNoDocumentsExistAndServiceIsCurrentlyDisabled(), ilTermsOfServiceCriterionFormGUITest\testFormForExistingAssignmentCannotBeSavedForInalidInput(), and ilTermsOfServiceDocumentFormGUITest\testUploadIssuesAreHandledWhenDocumentFormIsSaved().

39  : \ilLanguage
40  {
41  $lng = $this
42  ->getMockBuilder(\ilLanguage::class)
43  ->disableOriginalConstructor()
44  ->setMethods(['txt', 'getInstalledLanguages', 'loadLanguageModule'])
45  ->getMock();
46 
47  return $lng;
48  }
$lng
language handling
+ Here is the caller graph for this function:

◆ setGlobalVariable()

ilTermsOfServiceBaseTest::setGlobalVariable ( string  $name,
  $value 
)
protected

◆ setUp()

ilTermsOfServiceBaseTest::setUp ( )
protected

Definition at line 20 of file ilTermsOfServiceBaseTest.php.

References $dic, $GLOBALS, getLanguageMock(), and setGlobalVariable().

21  {
22  $this->dic = new Container();
23  $GLOBALS['DIC'] = $this->dic;
24 
25  $initRefl = new \ReflectionClass(\ilInitialisation::class);
26  $method = $initRefl->getMethod('initUIFramework');
27  $method->setAccessible(true);
28  $method->invoke($initRefl, $this->dic);
29 
30  $this->setGlobalVariable('lng', $this->getLanguageMock());
31  $this->setGlobalVariable('ilCtrl', $this->getMockBuilder(\ilCtrl::class)->disableOriginalConstructor()->getMock());
32 
33  parent::setUp();
34  }
setGlobalVariable(string $name, $value)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:16
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilTermsOfServiceBaseTest::$dic
protected

Definition at line 15 of file ilTermsOfServiceBaseTest.php.

Referenced by setUp().


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