ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilHtmlPurifierLibWrapperTest Class Reference

Class ilHtmlPurifierLibWrapperTest. More...

+ Inheritance diagram for ilHtmlPurifierLibWrapperTest:
+ Collaboration diagram for ilHtmlPurifierLibWrapperTest:

Public Member Functions

 testPurifierIsCalledIfStringsArePurified ()
 
 testExceptionIsRaisedIfNonStringElementsArePassedForHtmlBatchProcessing ($element)
 invalidHtmlDataTypeProvider More...
 

Static Public Member Functions

static invalidHtmlDataTypeProvider ()
 

Private Member Functions

 getPurifier ()
 

Private Attributes

const TO_PURIFY
 

Detailed Description

Member Function Documentation

◆ getPurifier()

ilHtmlPurifierLibWrapperTest::getPurifier ( )
private

Definition at line 35 of file ilHtmlPurifierLibWrapperTest.php.

Referenced by testExceptionIsRaisedIfNonStringElementsArePassedForHtmlBatchProcessing(), and testPurifierIsCalledIfStringsArePurified().

36  {
37  return new class () extends ilHtmlPurifierAbstractLibWrapper {
38  protected function getPurifierConfigInstance(): HTMLPurifier_Config
39  {
40  return HTMLPurifier_Config::createDefault();
41  }
42  };
43  }
+ Here is the caller graph for this function:

◆ invalidHtmlDataTypeProvider()

static ilHtmlPurifierLibWrapperTest::invalidHtmlDataTypeProvider ( )
static
Returns
array{integer: int[], float: float[], null: null[], array: never[][], object: [], bool: false[], resource: resource[]|false[]}

Definition at line 56 of file ilHtmlPurifierLibWrapperTest.php.

References null.

56  : array
57  {
58  return [
59  'integer' => [5],
60  'float' => [0.1],
61  'null' => [null],
62  'array' => [[]],
63  'object' => [new stdClass()],
64  'bool' => [false],
65  'resource' => [fopen('php://memory', 'rb')],
66  ];
67  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ testExceptionIsRaisedIfNonStringElementsArePassedForHtmlBatchProcessing()

ilHtmlPurifierLibWrapperTest::testExceptionIsRaisedIfNonStringElementsArePassedForHtmlBatchProcessing (   $element)

invalidHtmlDataTypeProvider

Definition at line 72 of file ilHtmlPurifierLibWrapperTest.php.

References getPurifier().

72  : void
73  {
74  $this->expectException(InvalidArgumentException::class);
75 
76  $purifier = $this->getPurifier();
77  $purifier->purifyArray([$element]);
78  }
+ Here is the call graph for this function:

◆ testPurifierIsCalledIfStringsArePurified()

ilHtmlPurifierLibWrapperTest::testPurifierIsCalledIfStringsArePurified ( )

Definition at line 45 of file ilHtmlPurifierLibWrapperTest.php.

References getPurifier().

45  : void
46  {
47  $purifier = $this->getPurifier();
48 
49  $this->assertSame('phpunit', $purifier->purify('phpunit'));
50  $this->assertSame(self::TO_PURIFY, $purifier->purifyArray(self::TO_PURIFY));
51  }
+ Here is the call graph for this function:

Field Documentation

◆ TO_PURIFY

const ilHtmlPurifierLibWrapperTest::TO_PURIFY
private
Initial value:
= [
'phpunit1',
'phpunit2',
'phpunit3',
]

Definition at line 29 of file ilHtmlPurifierLibWrapperTest.php.


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