◆ setUp()
ComponentHelperTest::setUp |
( |
| ) |
|
◆ test_cachesCanonicalName()
ComponentHelperTest::test_cachesCanonicalName |
( |
| ) |
|
Definition at line 88 of file ComponentHelperTest.php.
90 $name1 = $this->mock->getCanonicalName();
91 $name2 = $this->mock->getCanonicalName();
92 $this->assertEquals($name1, $name2);
93 $this->assertEquals(1, $this->mock->called_gcnbfqn);
◆ test_check_arg_instanceof_not_ok()
ComponentHelperTest::test_check_arg_instanceof_not_ok |
( |
| ) |
|
Definition at line 181 of file ComponentHelperTest.php.
184 $this->mock->_checkArgInstanceOf(
"some_arg", $this, ComponentMock::class);
185 $this->assertFalse(
"This should not happen.");
187 $this->assertEquals(
"Argument 'some_arg': expected ComponentMock, got ComponentHelperTest", $e->getMessage());
◆ test_check_arg_instanceof_ok()
ComponentHelperTest::test_check_arg_instanceof_ok |
( |
| ) |
|
Definition at line 172 of file ComponentHelperTest.php.
175 $this->mock->_checkArgInstanceOf(
"some_arg", $this->mock, ComponentMock::class);
177 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_is_element_ok()
ComponentHelperTest::test_check_arg_is_element_ok |
( |
| ) |
|
Definition at line 193 of file ComponentHelperTest.php.
196 $this->mock->_checkArgIsElement(
"some_arg",
"bar", array(
"foo",
"bar"),
"foobar");
198 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_list_elements_multi_class_not_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_not_ok |
( |
| ) |
|
Definition at line 258 of file ComponentHelperTest.php.
References $l.
262 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"Class1",
"Class2"));
263 $this->assertFalse(
"This should not happen.");
265 $this->assertEquals(
"Argument 'some_arg': expected Class1, Class2, got Class3", $e->getMessage());
◆ test_check_arg_list_elements_multi_class_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_ok |
( |
| ) |
|
Definition at line 248 of file ComponentHelperTest.php.
References $l.
252 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"Class1",
"Class2"));
254 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_list_elements_no_ok()
ComponentHelperTest::test_check_arg_list_elements_no_ok |
( |
| ) |
|
Definition at line 237 of file ComponentHelperTest.php.
References $l.
241 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"Class1"));
242 $this->assertFalse(
"This should not happen.");
244 $this->assertEquals(
"Argument 'some_arg': expected Class1, got Class2", $e->getMessage());
◆ test_check_arg_list_elements_ok()
ComponentHelperTest::test_check_arg_list_elements_ok |
( |
| ) |
|
Definition at line 227 of file ComponentHelperTest.php.
References $l.
231 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"Class1"));
233 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_list_elements_string_or_int_not_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_not_ok |
( |
| ) |
|
Definition at line 279 of file ComponentHelperTest.php.
References $l.
283 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"string",
"int"));
284 $this->assertFalse(
"This should not happen.");
286 $this->assertEquals(
"Argument 'some_arg': expected string, int, got Class1", $e->getMessage());
◆ test_check_arg_list_elements_string_or_int_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_ok |
( |
| ) |
|
Definition at line 269 of file ComponentHelperTest.php.
References $l.
271 $l = array(1,
"foo");
273 $this->mock->_checkArgListElements(
"some_arg",
$l, array(
"string",
"int"));
275 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_list_not_ok_1()
ComponentHelperTest::test_check_arg_list_not_ok_1 |
( |
| ) |
|
Definition at line 304 of file ComponentHelperTest.php.
References $l, and $m.
306 $l = array(
"a" => 1,
"b" => 2, 4 => 3);
308 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
309 return is_string($k) && is_int($v);
310 },
function ($k, $v) {
311 return "expected keys of type string and integer values, got ($k => $v)";
313 $this->assertFalse(
"This should not happen.");
315 $m =
"expected keys of type string and integer values, got (4 => 3)";
316 $this->assertEquals(
"Argument 'some_arg': $m", $e->getMessage());
◆ test_check_arg_list_not_ok_2()
ComponentHelperTest::test_check_arg_list_not_ok_2 |
( |
| ) |
|
Definition at line 320 of file ComponentHelperTest.php.
References $l, and $m.
322 $l = array(
"a" => 1,
"b" => 2,
"c" =>
"d");
324 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
325 return is_string($k) && is_int($v);
326 },
function ($k, $v) {
327 return "expected keys of type string and integer values, got ($k => $v)";
330 $this->assertFalse(
"This should not happen.");
332 $m =
"expected keys of type string and integer values, got (c => d)";
333 $this->assertEquals(
"Argument 'some_arg': $m", $e->getMessage());
◆ test_check_arg_list_ok()
ComponentHelperTest::test_check_arg_list_ok |
( |
| ) |
|
Definition at line 290 of file ComponentHelperTest.php.
References $l.
292 $l = array(
"a" => 1,
"b" => 2,
"c" => 3);
294 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
295 return is_string($k) && is_int($v);
296 },
function ($k, $v) {
297 return "expected keys of type string and integer values, got ($k => $v)";
300 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_not_ok()
ComponentHelperTest::test_check_arg_not_ok |
( |
| ) |
|
Definition at line 105 of file ComponentHelperTest.php.
108 $this->mock->_checkArg(
"some_arg",
false,
"some message");
109 $this->assertFalse(
"This should not happen.");
111 $this->assertEquals(
"Argument 'some_arg': some message", $e->getMessage());
◆ test_check_arg_ok()
ComponentHelperTest::test_check_arg_ok |
( |
| ) |
|
Definition at line 96 of file ComponentHelperTest.php.
99 $this->mock->_checkArg(
"some_arg",
true,
"some message");
101 $this->assertFalse(
"This should not happen.");
◆ test_check_bool_arg_not_ok()
ComponentHelperTest::test_check_bool_arg_not_ok |
( |
| ) |
|
Definition at line 162 of file ComponentHelperTest.php.
165 $this->mock->_checkBoolArg(
"some_arg", 1);
166 $this->assertFalse(
"This should not happen.");
168 $this->assertEquals(
"Argument 'some_arg': expected bool, got integer '1'", $e->getMessage());
◆ test_check_bool_arg_ok()
ComponentHelperTest::test_check_bool_arg_ok |
( |
| ) |
|
Definition at line 153 of file ComponentHelperTest.php.
156 $this->mock->_checkBoolArg(
"some_arg",
true);
158 $this->assertFalse(
"This should not happen.");
◆ test_check_float_arg_not_ok()
ComponentHelperTest::test_check_float_arg_not_ok |
( |
| ) |
|
Definition at line 346 of file ComponentHelperTest.php.
349 $this->mock->_checkFloatArg(
"some_arg",
"foo");
350 $this->assertFalse(
"This should not happen.");
352 $this->assertEquals(
"Argument 'some_arg': expected float, got string 'foo'", $e->getMessage());
◆ test_check_float_arg_ok()
ComponentHelperTest::test_check_float_arg_ok |
( |
| ) |
|
Definition at line 337 of file ComponentHelperTest.php.
340 $this->mock->_checkFloatArg(
"some_arg", 1.73);
342 $this->assertFalse(
"This should not happen.");
◆ test_check_int_arg_not_ok()
ComponentHelperTest::test_check_int_arg_not_ok |
( |
| ) |
|
Definition at line 124 of file ComponentHelperTest.php.
127 $this->mock->_checkIntArg(
"some_arg",
"foo");
128 $this->assertFalse(
"This should not happen.");
130 $this->assertEquals(
"Argument 'some_arg': expected integer, got string 'foo'", $e->getMessage());
◆ test_check_int_arg_ok()
ComponentHelperTest::test_check_int_arg_ok |
( |
| ) |
|
Definition at line 115 of file ComponentHelperTest.php.
118 $this->mock->_checkIntArg(
"some_arg", 1);
120 $this->assertFalse(
"This should not happen.");
◆ test_check_string_arg_is_element_not_ok()
ComponentHelperTest::test_check_string_arg_is_element_not_ok |
( |
| ) |
|
Definition at line 202 of file ComponentHelperTest.php.
205 $this->mock->_checkArgIsElement(
"some_arg",
"baz", array(
"foo",
"bar"),
"foobar");
206 $this->assertFalse(
"This should not happen.");
208 $this->assertEquals(
"Argument 'some_arg': expected foobar, got 'baz'", $e->getMessage());
◆ test_check_string_arg_not_ok()
ComponentHelperTest::test_check_string_arg_not_ok |
( |
| ) |
|
Definition at line 143 of file ComponentHelperTest.php.
146 $this->mock->_checkStringArg(
"some_arg", 1);
147 $this->assertFalse(
"This should not happen.");
149 $this->assertEquals(
"Argument 'some_arg': expected string, got integer '1'", $e->getMessage());
◆ test_check_string_arg_ok()
ComponentHelperTest::test_check_string_arg_ok |
( |
| ) |
|
Definition at line 134 of file ComponentHelperTest.php.
137 $this->mock->_checkStringArg(
"some_arg",
"bar");
139 $this->assertFalse(
"This should not happen.");
◆ test_getCanonicalName()
ComponentHelperTest::test_getCanonicalName |
( |
| ) |
|
Definition at line 82 of file ComponentHelperTest.php.
References $c.
84 $c = new \ILIAS\UI\Component\Test\TestComponent(
"foo");
85 $this->assertEquals(
"Test Component Test",
$c->getCanonicalName());
◆ test_to_array_with_array()
ComponentHelperTest::test_to_array_with_array |
( |
| ) |
|
Definition at line 212 of file ComponentHelperTest.php.
References $res.
214 $foo = array(
"foo",
"bar");
215 $res = $this->mock->_toArray($foo);
217 $this->assertEquals($foo,
$res);
foreach($_POST as $key=> $value) $res
◆ test_to_array_with_int()
ComponentHelperTest::test_to_array_with_int |
( |
| ) |
|
Definition at line 220 of file ComponentHelperTest.php.
References $res.
223 $res = $this->mock->_toArray($foo);
224 $this->assertEquals(array($foo),
$res);
foreach($_POST as $key=> $value) $res
The documentation for this class was generated from the following file: