|
static array | $result = ["I am", "a test string", "for split"] |
|
Definition at line 26 of file SplitStringTest.php.
◆ setUp()
SplitStringTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 36 of file SplitStringTest.php.
36 : void
37 {
38 $dataFactory = new DataFactory();
39 $language = $this->createMock(
ILIAS\Language\Language::class);
40 $this->f = new Refinery($dataFactory, $language);
41 $this->split_string = $this->f->string()->splitString("#");
42 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
◆ tearDown()
SplitStringTest::tearDown |
( |
| ) |
|
|
protected |
Definition at line 44 of file SplitStringTest.php.
44 : void
45 {
46 $this->f = null;
47 $this->split_string = null;
48 }
◆ testApplyToWithInvalidValueWillLeadToErrorResult()
SplitStringTest::testApplyToWithInvalidValueWillLeadToErrorResult |
( |
| ) |
|
Definition at line 136 of file SplitStringTest.php.
136 : void
137 {
138 $factory = new DataFactory();
139 $valueObject = $factory->ok(42);
140
141 $resultObject = $this->split_string->applyTo($valueObject);
142
143 $this->assertTrue($resultObject->isError());
144 }
◆ testApplyToWithValidValueReturnsAnOkResult()
SplitStringTest::testApplyToWithValidValueReturnsAnOkResult |
( |
| ) |
|
Definition at line 125 of file SplitStringTest.php.
125 : void
126 {
127 $factory = new DataFactory();
128 $valueObject = $factory->ok(self::STRING_TO_SPLIT);
129
130 $resultObject = $this->split_string->applyTo($valueObject);
131
132 $this->assertEquals(self::$result, $resultObject->value());
133 $this->assertFalse($resultObject->isError());
134 }
◆ testInvoke()
SplitStringTest::testInvoke |
( |
| ) |
|
Definition at line 86 of file SplitStringTest.php.
86 : void
87 {
90 $this->assertEquals(static::$result, $arr);
91 }
Transformation $split_string
References $split_string.
◆ testInvokeFails()
SplitStringTest::testInvokeFails |
( |
| ) |
|
Definition at line 93 of file SplitStringTest.php.
93 : void
94 {
96
97 $raised = false;
98 try {
99 $arr = [];
101 }
catch (InvalidArgumentException
$e) {
102 $raised = true;
103 }
104 $this->assertTrue($raised);
105
106 $raised = false;
107 try {
108 $number = 1001;
110 }
catch (InvalidArgumentException
$e) {
111 $raised = true;
112 }
113 $this->assertTrue($raised);
114
115 $raised = false;
116 try {
117 $std_class = new stdClass();
119 }
catch (InvalidArgumentException
$e) {
120 $raised = true;
121 }
122 $this->assertTrue($raised);
123 }
References Vendor\Package\$e, and $split_string.
◆ testTransform()
SplitStringTest::testTransform |
( |
| ) |
|
Definition at line 50 of file SplitStringTest.php.
50 : void
51 {
52 $arr = $this->split_string->transform(self::STRING_TO_SPLIT);
53 $this->assertEquals(static::$result, $arr);
54 }
◆ testTransformFails()
SplitStringTest::testTransformFails |
( |
| ) |
|
Definition at line 56 of file SplitStringTest.php.
56 : void
57 {
58 $raised = false;
59 try {
60 $arr = [];
61 $next_arr = $this->split_string->transform($arr);
62 }
catch (InvalidArgumentException
$e) {
63 $raised = true;
64 }
65 $this->assertTrue($raised);
66
67 $raised = false;
68 try {
69 $without = 1001;
70 $with = $this->split_string->transform($without);
71 }
catch (InvalidArgumentException
$e) {
72 $raised = true;
73 }
74 $this->assertTrue($raised);
75
76 $raised = false;
77 try {
78 $std_class = new stdClass();
79 $with = $this->split_string->transform($std_class);
80 }
catch (InvalidArgumentException
$e) {
81 $raised = true;
82 }
83 $this->assertTrue($raised);
84 }
References Vendor\Package\$e.
◆ $f
Refinery SplitStringTest::$f |
|
private |
◆ $result
array SplitStringTest::$result = ["I am", "a test string", "for split"] |
|
staticprotected |
◆ $split_string
◆ STRING_TO_SPLIT
const SplitStringTest::STRING_TO_SPLIT = "I am#a test string#for split" |
|
private |
The documentation for this class was generated from the following file: