◆ setUp()
ComponentHelperTest::setUp |
( |
| ) |
|
◆ test_check_arg_instanceof_not_ok()
ComponentHelperTest::test_check_arg_instanceof_not_ok |
( |
| ) |
|
Definition at line 117 of file ComponentHelperTest.php.
119 $this->mock->_checkArgInstanceOf(
"some_arg", $this, ComponentMock::class);
120 $this->assertFalse(
"This should not happen.");
123 $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 108 of file ComponentHelperTest.php.
110 $this->mock->_checkArgInstanceOf(
"some_arg", $this->mock, ComponentMock::class);
113 $this->assertFalse(
"This should not happen.");
◆ test_check_arg_is_element_ok()
ComponentHelperTest::test_check_arg_is_element_ok |
( |
| ) |
|
Definition at line 129 of file ComponentHelperTest.php.
References array.
131 $this->mock->_checkArgIsElement(
"some_arg",
"bar",
array(
"foo",
"bar"),
"foobar");
134 $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 192 of file ComponentHelperTest.php.
References $l, and array.
195 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1",
"Class2"));
196 $this->assertFalse(
"This should not happen.");
199 $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 182 of file ComponentHelperTest.php.
References $l, and array.
185 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1",
"Class2"));
188 $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 171 of file ComponentHelperTest.php.
References $l, and array.
174 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1"));
175 $this->assertFalse(
"This should not happen.");
178 $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 161 of file ComponentHelperTest.php.
References $l, and array.
164 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"Class1"));
167 $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 213 of file ComponentHelperTest.php.
References $l, and array.
216 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"string",
"int"));
217 $this->assertFalse(
"This should not happen.");
220 $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 203 of file ComponentHelperTest.php.
References $l, and array.
206 $this->mock->_checkArgListElements(
"some_arg",
$l,
array(
"string",
"int"));
209 $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 242 of file ComponentHelperTest.php.
References $l, and array.
243 $l =
array(
"a" => 1,
"b" => 2, 4 => 3);
245 $this->mock->_checkArgList
249 return is_string($k) && is_int($v);
252 return "expected keys of type string and integer values, got ($k => $v)";
254 $this->assertFalse(
"This should not happen.");
257 $m =
"expected keys of type string and integer values, got (4 => 3)";
258 $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 262 of file ComponentHelperTest.php.
References $l, and array.
263 $l =
array(
"a" => 1,
"b" => 2,
"c" =>
"d");
265 $this->mock->_checkArgList
269 return is_string($k) && is_int($v);
272 return "expected keys of type string and integer values, got ($k => $v)";
275 $this->assertFalse(
"This should not happen.");
278 $m =
"expected keys of type string and integer values, got (c => d)";
279 $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 224 of file ComponentHelperTest.php.
References $l, and array.
225 $l =
array(
"a" => 1,
"b" => 2,
"c" => 3);
227 $this->mock->_checkArgList
231 return is_string($k) && is_int($v);
234 return "expected keys of type string and integer values, got ($k => $v)";
238 $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 60 of file ComponentHelperTest.php.
62 $this->mock->_checkArg(
"some_arg",
false,
"some message");
63 $this->assertFalse(
"This should not happen.");
66 $this->assertEquals(
"Argument 'some_arg': some message", $e->getMessage());
◆ test_check_arg_ok()
ComponentHelperTest::test_check_arg_ok |
( |
| ) |
|
Definition at line 51 of file ComponentHelperTest.php.
53 $this->mock->_checkArg(
"some_arg",
true,
"some message");
56 $this->assertFalse(
"This should not happen.");
◆ test_check_int_arg_not_ok()
ComponentHelperTest::test_check_int_arg_not_ok |
( |
| ) |
|
Definition at line 79 of file ComponentHelperTest.php.
81 $this->mock->_checkIntArg(
"some_arg",
"foo");
82 $this->assertFalse(
"This should not happen.");
85 $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 70 of file ComponentHelperTest.php.
72 $this->mock->_checkIntArg(
"some_arg", 1);
75 $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 138 of file ComponentHelperTest.php.
References array.
140 $this->mock->_checkArgIsElement(
"some_arg",
"baz",
array(
"foo",
"bar"),
"foobar");
141 $this->assertFalse(
"This should not happen.");
144 $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 98 of file ComponentHelperTest.php.
100 $this->mock->_checkStringArg(
"some_arg", 1);
101 $this->assertFalse(
"This should not happen.");
104 $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 89 of file ComponentHelperTest.php.
91 $this->mock->_checkStringArg(
"some_arg",
"bar");
94 $this->assertFalse(
"This should not happen.");
◆ test_to_array_with_array()
ComponentHelperTest::test_to_array_with_array |
( |
| ) |
|
Definition at line 148 of file ComponentHelperTest.php.
References $res, and array.
149 $foo =
array(
"foo",
"bar");
150 $res = $this->mock->_toArray($foo);
152 $this->assertEquals($foo,
$res);
Create styles array
The data for the language used.
◆ test_to_array_with_int()
ComponentHelperTest::test_to_array_with_int |
( |
| ) |
|
The documentation for this class was generated from the following file: