ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
NullTransformationTest Class Reference
+ Inheritance diagram for NullTransformationTest:
+ Collaboration diagram for NullTransformationTest:

Public Member Functions

 testNullTransformation ($value, bool $valid)
 NullTestDataProvider More...
 

Static Public Member Functions

static NullTestDataProvider ()
 

Protected Member Functions

 setUp ()
 

Private Attributes

NullTransformation $transformation
 

Detailed Description

Definition at line 25 of file NullTransformationTest.php.

Member Function Documentation

◆ NullTestDataProvider()

static NullTransformationTest::NullTestDataProvider ( )
static

Definition at line 34 of file NullTransformationTest.php.

References null.

34  : array
35  {
36  return [
37  'empty string' => ['', true],
38  'space' => [' ', true],
39  'spaces' => [' ', true],
40  'null' => [null, true],
41  'string' => ['str', false],
42  'int' => [1, false],
43  'negative int' => [-1, false],
44  'zero' => [0, false],
45  'array' => [[], false],
46  'bool (false)' => [false, false],
47  'bool (true)' => [true, false]
48  ];
49  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ setUp()

NullTransformationTest::setUp ( )
protected

Definition at line 29 of file NullTransformationTest.php.

29  : void
30  {
31  $this->transformation = new NullTransformation();
32  }

◆ testNullTransformation()

NullTransformationTest::testNullTransformation (   $value,
bool  $valid 
)

NullTestDataProvider

Parameters
mixed$value
bool$valid
Exceptions
Exception

Definition at line 57 of file NullTransformationTest.php.

57  : void
58  {
59  if (!$valid) {
60  $this->expectException(ConstraintViolationException::class);
61  }
62  $transformed = $this->transformation->transform($value);
63  $this->assertNull($transformed);
64  }
$valid

Field Documentation

◆ $transformation

NullTransformation NullTransformationTest::$transformation
private

Definition at line 27 of file NullTransformationTest.php.


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