ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
NullTransformationTest Class Reference
+ Inheritance diagram for NullTransformationTest:
+ Collaboration diagram for NullTransformationTest:

Public Member Functions

 testNullTransformation (mixed $value, bool $valid)
 

Static Public Member Functions

static NullTestDataProvider ()
 

Protected Member Functions

 setUp ()
 

Private Attributes

NullTransformation $transformation
 

Detailed Description

Definition at line 26 of file NullTransformationTest.php.

Member Function Documentation

◆ NullTestDataProvider()

static NullTransformationTest::NullTestDataProvider ( )
static

Definition at line 35 of file NullTransformationTest.php.

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

◆ setUp()

NullTransformationTest::setUp ( )
protected

Definition at line 30 of file NullTransformationTest.php.

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

◆ testNullTransformation()

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

Definition at line 53 of file NullTransformationTest.php.

53 : void
54 {
55 if (!$valid) {
56 $this->expectException(ConstraintViolationException::class);
57 }
58 $transformed = $this->transformation->transform($value);
59 $this->assertNull($transformed);
60 }
$valid

References $valid.

Field Documentation

◆ $transformation

NullTransformation NullTransformationTest::$transformation
private

Definition at line 28 of file NullTransformationTest.php.


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