Definition at line 29 of file ByTryingTransformTest.php.
◆ NullOrNumericDataProvider()
static ByTryingTransformTest::NullOrNumericDataProvider |
( |
| ) |
|
|
static |
Definition at line 42 of file ByTryingTransformTest.php.
References null.
45 'empty string' => [
'',
null],
46 'empty string - one space' => [
' ',
null],
47 'empty string - more spaces' => [
' ',
null],
49 'string' => [
'str', self::ERROR],
51 'negative int' => [-1, -1],
53 'array' => [[], self::ERROR],
54 'bool (false)' => [
false, self::ERROR],
55 'bool (true)' => [
true, self::ERROR]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ NullOrNumericOrStringDataProvider()
static ByTryingTransformTest::NullOrNumericOrStringDataProvider |
( |
| ) |
|
|
static |
Definition at line 75 of file ByTryingTransformTest.php.
References null.
78 'string' => [
'str',
'str'],
80 'empty string' => [
'',
null],
82 'bool (true)' => [
true, self::ERROR],
83 '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 103 of file ByTryingTransformTest.php.
References null.
106 'string' => [
'str',
'str'],
108 'empty string' => [
'',
''],
109 'int' => [1, self::ERROR],
110 'array' => [[], self::ERROR]
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ testNullOrNumeric()
ByTryingTransformTest::testNullOrNumeric |
( |
mixed |
$value, |
|
|
mixed |
$expected |
|
) |
| |
Definition at line 60 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
62 $transformation = $this->
refinery->byTrying([
63 $this->
refinery->numeric()->isNumeric(),
67 if ($expected === self::ERROR) {
68 $this->expectException(ConstraintViolationException::class);
70 $transformed = $transformation->transform($value);
71 $this->assertEquals($expected, $transformed);
◆ testNullOrNumericOrString()
ByTryingTransformTest::testNullOrNumericOrString |
( |
mixed |
$value, |
|
|
mixed |
$expected |
|
) |
| |
Definition at line 88 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
90 $transformation = $this->
refinery->byTrying([
92 $this->
refinery->numeric()->isNumeric(),
96 if ($expected === self::ERROR) {
97 $this->expectException(ConstraintViolationException::class);
99 $transformed = $transformation->transform($value);
100 $this->assertEquals($expected, $transformed);
◆ testStringOrNull()
ByTryingTransformTest::testStringOrNull |
( |
mixed |
$value, |
|
|
mixed |
$expected |
|
) |
| |
Definition at line 115 of file ByTryingTransformTest.php.
References ILIAS\Repository\refinery().
117 $transformation = $this->
refinery->byTrying([
122 if ($expected === self::ERROR) {
123 $this->expectException(ConstraintViolationException::class);
125 $transformed = $transformation->transform($value);
126 $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: