◆ setUp()
ComponentHelperTest::setUp |
( |
| ) |
|
◆ test_cachesCanonicalName()
ComponentHelperTest::test_cachesCanonicalName |
( |
| ) |
|
Definition at line 84 of file ComponentHelperTest.php.
86 $name1 = $this->mock->getCanonicalName();
87 $name2 = $this->mock->getCanonicalName();
88 $this->assertEquals($name1, $name2);
89 $this->assertEquals(1, $this->mock->called_gcnbfqn);
◆ test_check_arg_instanceof_not_ok()
ComponentHelperTest::test_check_arg_instanceof_not_ok |
( |
| ) |
|
Definition at line 158 of file ComponentHelperTest.php.
161 $this->mock->_checkArgInstanceOf(
"some_arg", $this, ComponentMock::class);
162 $this->assertFalse(
"This should not happen.");
164 $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 149 of file ComponentHelperTest.php.
152 $this->mock->_checkArgInstanceOf(
"some_arg", $this->mock, ComponentMock::class);
154 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_is_element_ok()
ComponentHelperTest::test_check_arg_is_element_ok |
( |
| ) |
|
Definition at line 170 of file ComponentHelperTest.php.
References array.
173 $this->mock->_checkArgIsElement(
"some_arg",
"bar",
array(
"foo",
"bar"),
"foobar");
175 $this->assertFalse(
"This should not happen.");
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_multi_class_not_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_not_ok |
( |
| ) |
|
Definition at line 235 of file ComponentHelperTest.php.
References $l, and array.
239 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1",
"Class2"));
240 $this->assertFalse(
"This should not happen.");
242 $this->assertEquals(
"Argument 'some_arg': expected Class1, Class2, got Class3", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_multi_class_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_ok |
( |
| ) |
|
Definition at line 225 of file ComponentHelperTest.php.
References $l, and array.
229 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1",
"Class2"));
231 $this->assertFalse(
"This should not happen.");
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_no_ok()
ComponentHelperTest::test_check_arg_list_elements_no_ok |
( |
| ) |
|
Definition at line 214 of file ComponentHelperTest.php.
References $l, and array.
218 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1"));
219 $this->assertFalse(
"This should not happen.");
221 $this->assertEquals(
"Argument 'some_arg': expected Class1, got Class2", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_ok()
ComponentHelperTest::test_check_arg_list_elements_ok |
( |
| ) |
|
Definition at line 204 of file ComponentHelperTest.php.
References $l, and array.
208 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1"));
210 $this->assertFalse(
"This should not happen.");
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_string_or_int_not_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_not_ok |
( |
| ) |
|
Definition at line 256 of file ComponentHelperTest.php.
References $l, and array.
260 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"string",
"int"));
261 $this->assertFalse(
"This should not happen.");
263 $this->assertEquals(
"Argument 'some_arg': expected string, int, got Class1", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_arg_list_elements_string_or_int_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_ok |
( |
| ) |
|
Definition at line 246 of file ComponentHelperTest.php.
References $l, and array.
250 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"string",
"int"));
252 $this->assertFalse(
"This should not happen.");
Create styles array
The data for the language used.
◆ test_check_arg_list_not_ok_1()
ComponentHelperTest::test_check_arg_list_not_ok_1 |
( |
| ) |
|
Definition at line 281 of file ComponentHelperTest.php.
References $l, $m, and array.
283 $l =
array(
"a" => 1,
"b" => 2, 4 => 3);
285 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
286 return is_string($k) && is_int($v);
287 },
function ($k, $v) {
288 return "expected keys of type string and integer values, got ($k => $v)";
290 $this->assertFalse(
"This should not happen.");
292 $m =
"expected keys of type string and integer values, got (4 => 3)";
293 $this->assertEquals(
"Argument 'some_arg': $m", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_arg_list_not_ok_2()
ComponentHelperTest::test_check_arg_list_not_ok_2 |
( |
| ) |
|
Definition at line 297 of file ComponentHelperTest.php.
References $l, $m, and array.
299 $l =
array(
"a" => 1,
"b" => 2,
"c" =>
"d");
301 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
302 return is_string($k) && is_int($v);
303 },
function ($k, $v) {
304 return "expected keys of type string and integer values, got ($k => $v)";
307 $this->assertFalse(
"This should not happen.");
309 $m =
"expected keys of type string and integer values, got (c => d)";
310 $this->assertEquals(
"Argument 'some_arg': $m", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_arg_list_ok()
ComponentHelperTest::test_check_arg_list_ok |
( |
| ) |
|
Definition at line 267 of file ComponentHelperTest.php.
References $l, and array.
269 $l =
array(
"a" => 1,
"b" => 2,
"c" => 3);
271 $this->mock->_checkArgList(
"some_arg",
$l,
function ($k, $v) {
272 return is_string($k) && is_int($v);
273 },
function ($k, $v) {
274 return "expected keys of type string and integer values, got ($k => $v)";
277 $this->assertFalse(
"This should not happen.");
Create styles array
The data for the language used.
◆ test_check_arg_not_ok()
ComponentHelperTest::test_check_arg_not_ok |
( |
| ) |
|
Definition at line 101 of file ComponentHelperTest.php.
104 $this->mock->_checkArg(
"some_arg",
false,
"some message");
105 $this->assertFalse(
"This should not happen.");
107 $this->assertEquals(
"Argument 'some_arg': some message", $e->getMessage());
◆ test_check_arg_ok()
ComponentHelperTest::test_check_arg_ok |
( |
| ) |
|
Definition at line 92 of file ComponentHelperTest.php.
95 $this->mock->_checkArg(
"some_arg",
true,
"some message");
97 $this->assertFalse(
"This should not happen.");
◆ test_check_float_arg_not_ok()
ComponentHelperTest::test_check_float_arg_not_ok |
( |
| ) |
|
Definition at line 323 of file ComponentHelperTest.php.
326 $this->mock->_checkFloatArg(
"some_arg",
"foo");
327 $this->assertFalse(
"This should not happen.");
329 $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 314 of file ComponentHelperTest.php.
317 $this->mock->_checkFloatArg(
"some_arg", 1.73);
319 $this->assertFalse(
"This should not happen.");
◆ test_check_int_arg_not_ok()
ComponentHelperTest::test_check_int_arg_not_ok |
( |
| ) |
|
Definition at line 120 of file ComponentHelperTest.php.
123 $this->mock->_checkIntArg(
"some_arg",
"foo");
124 $this->assertFalse(
"This should not happen.");
126 $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 111 of file ComponentHelperTest.php.
114 $this->mock->_checkIntArg(
"some_arg", 1);
116 $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 179 of file ComponentHelperTest.php.
References array.
182 $this->mock->_checkArgIsElement(
"some_arg",
"baz",
array(
"foo",
"bar"),
"foobar");
183 $this->assertFalse(
"This should not happen.");
185 $this->assertEquals(
"Argument 'some_arg': expected foobar, got 'baz'", $e->getMessage());
Create styles array
The data for the language used.
◆ test_check_string_arg_not_ok()
ComponentHelperTest::test_check_string_arg_not_ok |
( |
| ) |
|
Definition at line 139 of file ComponentHelperTest.php.
142 $this->mock->_checkStringArg(
"some_arg", 1);
143 $this->assertFalse(
"This should not happen.");
145 $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 130 of file ComponentHelperTest.php.
133 $this->mock->_checkStringArg(
"some_arg",
"bar");
135 $this->assertFalse(
"This should not happen.");
◆ test_getCanonicalName()
ComponentHelperTest::test_getCanonicalName |
( |
| ) |
|
Definition at line 78 of file ComponentHelperTest.php.
80 $c = new \ILIAS\UI\Component\Test\TestComponent(
"foo");
81 $this->assertEquals(
"Test Component Test", $c->getCanonicalName());
◆ test_to_array_with_array()
ComponentHelperTest::test_to_array_with_array |
( |
| ) |
|
Definition at line 189 of file ComponentHelperTest.php.
References $res, and array.
191 $foo =
array(
"foo",
"bar");
192 $res = $this->mock->_toArray($foo);
194 $this->assertEquals($foo,
$res);
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ test_to_array_with_int()
ComponentHelperTest::test_to_array_with_int |
( |
| ) |
|
Definition at line 197 of file ComponentHelperTest.php.
References $res, and array.
200 $res = $this->mock->_toArray($foo);
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: