Definition at line 28 of file ByTryingTransformTest.php.
◆ NullOrNumericDataProvider()
static ByTryingTransformTest::NullOrNumericDataProvider |
( |
| ) |
|
|
static |
Definition at line 41 of file ByTryingTransformTest.php.
References null.
44 'empty string' => [
'',
null],
45 'empty string - one space' => [
' ',
null],
46 'empty string - more spaces' => [
' ',
null],
48 'string' => [
'str', self::ERROR],
50 'negative int' => [-1, -1],
52 'array' => [[], self::ERROR],
53 'bool (false)' => [
false, self::ERROR],
54 'bool (true)' => [
true, self::ERROR]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ NullOrNumericOrStringDataProvider()
static ByTryingTransformTest::NullOrNumericOrStringDataProvider |
( |
| ) |
|
|
static |
Definition at line 78 of file ByTryingTransformTest.php.
References null.
81 'string' => [
'str',
'str'],
83 'empty string' => [
'',
null],
85 'bool (true)' => [
true, self::ERROR],
86 'array' => [[], self::ERROR]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ setUp()
ByTryingTransformTest::setUp |
( |
| ) |
|
|
protected |
◆ StringOrNullDataProvider()
static ByTryingTransformTest::StringOrNullDataProvider |
( |
| ) |
|
|
static |
Definition at line 110 of file ByTryingTransformTest.php.
References null.
113 'string' => [
'str',
'str'],
115 'empty string' => [
'',
''],
116 'int' => [1, self::ERROR],
117 'array' => [[], self::ERROR]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testNullOrNumeric()
ByTryingTransformTest::testNullOrNumeric |
( |
|
$value, |
|
|
|
$expected |
|
) |
| |
NullOrNumericDataProvider
- Parameters
-
mixed | $value | |
mixed | $expected | |
Definition at line 63 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
65 $transformation = $this->
refinery->byTrying([
66 $this->
refinery->numeric()->isNumeric(),
70 if ($expected === self::ERROR) {
71 $this->expectException(ConstraintViolationException::class);
73 $transformed = $transformation->transform($value);
74 $this->assertEquals($expected, $transformed);
◆ testNullOrNumericOrString()
ByTryingTransformTest::testNullOrNumericOrString |
( |
|
$value, |
|
|
|
$expected |
|
) |
| |
NullOrNumericOrStringDataProvider
- Parameters
-
mixed | $value | |
mixed | $expected | |
Definition at line 95 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
97 $transformation = $this->
refinery->byTrying([
99 $this->
refinery->numeric()->isNumeric(),
103 if ($expected === self::ERROR) {
104 $this->expectException(ConstraintViolationException::class);
106 $transformed = $transformation->transform($value);
107 $this->assertEquals($expected, $transformed);
◆ testStringOrNull()
ByTryingTransformTest::testStringOrNull |
( |
|
$value, |
|
|
|
$expected |
|
) |
| |
StringOrNullDataProvider
- Parameters
-
mixed | $value | |
mixed | $expected | |
Definition at line 126 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
128 $transformation = $this->
refinery->byTrying([
133 if ($expected === self::ERROR) {
134 $this->expectException(ConstraintViolationException::class);
136 $transformed = $transformation->transform($value);
137 $this->assertEquals($expected, $transformed);
◆ $refinery
Refinery ByTryingTransformTest::$refinery |
|
private |
◆ ERROR
const ByTryingTransformTest::ERROR = 'error_expected' |
|
private |
The documentation for this class was generated from the following file: