◆ setUp()
ComponentHelperTest::setUp |
( |
| ) |
|
◆ test_check_arg_instanceof_not_ok()
ComponentHelperTest::test_check_arg_instanceof_not_ok |
( |
| ) |
|
Definition at line 157 of file ComponentHelperTest.php.
159 $this->expectException(InvalidArgumentException::class);
160 $this->expectExceptionMessage(
"Argument 'some_arg': expected ComponentMock, got ComponentHelperTest");
161 $this->mock->_checkArgInstanceOf(
"some_arg", $this, ComponentMock::class);
◆ test_check_arg_instanceof_ok()
ComponentHelperTest::test_check_arg_instanceof_ok |
( |
| ) |
|
Definition at line 152 of file ComponentHelperTest.php.
154 $this->mock->_checkArgInstanceOf(
"some_arg", $this->mock, ComponentMock::class);
◆ test_check_arg_is_element_ok()
ComponentHelperTest::test_check_arg_is_element_ok |
( |
| ) |
|
Definition at line 168 of file ComponentHelperTest.php.
170 $this->mock->_checkArgIsElement(
"some_arg",
"bar", array(
"foo",
"bar"),
"foobar");
◆ test_check_arg_list_elements_multi_class_not_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_not_ok |
( |
| ) |
|
Definition at line 221 of file ComponentHelperTest.php.
223 $this->expectException(InvalidArgumentException::class);
224 $this->expectExceptionMessage(
"Argument 'some_arg': expected Class1, Class2, got Class3");
226 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"Class1",
"Class2"));
◆ test_check_arg_list_elements_multi_class_ok()
ComponentHelperTest::test_check_arg_list_elements_multi_class_ok |
( |
| ) |
|
Definition at line 215 of file ComponentHelperTest.php.
218 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"Class1",
"Class2"));
◆ test_check_arg_list_elements_no_ok()
ComponentHelperTest::test_check_arg_list_elements_no_ok |
( |
| ) |
|
Definition at line 204 of file ComponentHelperTest.php.
206 $this->expectException(InvalidArgumentException::class);
207 $this->expectExceptionMessage(
"Argument 'some_arg': expected Class1, got Class2");
209 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"Class1"));
◆ test_check_arg_list_elements_ok()
ComponentHelperTest::test_check_arg_list_elements_ok |
( |
| ) |
|
◆ test_check_arg_list_elements_string_or_int_not_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_not_ok |
( |
| ) |
|
Definition at line 238 of file ComponentHelperTest.php.
240 $this->expectException(InvalidArgumentException::class);
241 $this->expectExceptionMessage(
"Argument 'some_arg': expected string, int, got Class1");
242 $l = array(1,
new Class1());
243 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"string",
"int"));
◆ test_check_arg_list_elements_string_or_int_ok()
ComponentHelperTest::test_check_arg_list_elements_string_or_int_ok |
( |
| ) |
|
Definition at line 232 of file ComponentHelperTest.php.
234 $l = array(1,
"foo");
235 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"string",
"int"));
◆ test_check_arg_list_not_ok_1()
ComponentHelperTest::test_check_arg_list_not_ok_1 |
( |
| ) |
|
Definition at line 259 of file ComponentHelperTest.php.
261 $m =
"expected keys of type string and integer values, got (4 => 3)";
262 $this->expectException(InvalidArgumentException::class);
263 $this->expectExceptionMessage(
"Argument 'some_arg': $m");
264 $l = array(
"a" => 1,
"b" => 2, 4 => 3);
265 $this->mock->_checkArgList(
"some_arg", $l,
function ($k, $v) {
266 return is_string($k) && is_int($v);
267 },
function ($k, $v) {
268 return "expected keys of type string and integer values, got ($k => $v)";
◆ test_check_arg_list_not_ok_2()
ComponentHelperTest::test_check_arg_list_not_ok_2 |
( |
| ) |
|
Definition at line 272 of file ComponentHelperTest.php.
274 $m =
"expected keys of type string and integer values, got (c => d)";
275 $this->expectException(InvalidArgumentException::class);
276 $this->expectExceptionMessage(
"Argument 'some_arg': $m");
277 $l = array(
"a" => 1,
"b" => 2,
"c" =>
"d");
278 $this->mock->_checkArgList(
"some_arg", $l,
function ($k, $v) {
279 return is_string($k) && is_int($v);
280 },
function ($k, $v) {
281 return "expected keys of type string and integer values, got ($k => $v)";
◆ test_check_arg_list_ok()
ComponentHelperTest::test_check_arg_list_ok |
( |
| ) |
|
Definition at line 249 of file ComponentHelperTest.php.
251 $l = array(
"a" => 1,
"b" => 2,
"c" => 3);
252 $this->mock->_checkArgList(
"some_arg", $l,
function ($k, $v) {
253 return is_string($k) && is_int($v);
254 },
function ($k, $v) {
255 return "expected keys of type string and integer values, got ($k => $v)";
◆ test_check_arg_not_ok()
ComponentHelperTest::test_check_arg_not_ok |
( |
| ) |
|
Definition at line 112 of file ComponentHelperTest.php.
114 $this->expectException(InvalidArgumentException::class);
115 $this->expectExceptionMessage(
"Argument 'some_arg': some message");
116 $this->mock->_checkArg(
"some_arg",
false,
"some message");
◆ test_check_arg_ok()
ComponentHelperTest::test_check_arg_ok |
( |
| ) |
|
◆ test_check_bool_arg_not_ok()
ComponentHelperTest::test_check_bool_arg_not_ok |
( |
| ) |
|
Definition at line 142 of file ComponentHelperTest.php.
144 $this->expectException(InvalidArgumentException::class);
145 $this->expectExceptionMessage(
"Argument 'some_arg': expected bool, got integer '1'");
146 $this->mock->_checkBoolArg(
"some_arg", 1);
◆ test_check_bool_arg_ok()
ComponentHelperTest::test_check_bool_arg_ok |
( |
| ) |
|
◆ test_check_string_arg_is_element_not_ok()
ComponentHelperTest::test_check_string_arg_is_element_not_ok |
( |
| ) |
|
Definition at line 173 of file ComponentHelperTest.php.
175 $this->expectException(InvalidArgumentException::class);
176 $this->expectExceptionMessage(
"Argument 'some_arg': expected foobar, got 'baz'");
177 $this->mock->_checkArgIsElement(
"some_arg",
"baz", array(
"foo",
"bar"),
"foobar");
◆ test_check_string_arg_not_ok()
ComponentHelperTest::test_check_string_arg_not_ok |
( |
| ) |
|
Definition at line 127 of file ComponentHelperTest.php.
129 $this->expectException(InvalidArgumentException::class);
130 $this->expectExceptionMessage(
"Argument 'some_arg': expected string, got integer '1'");
131 $this->mock->_checkStringArg(
"some_arg", 1);
◆ test_check_string_arg_ok()
ComponentHelperTest::test_check_string_arg_ok |
( |
| ) |
|
◆ test_getCanonicalName()
ComponentHelperTest::test_getCanonicalName |
( |
| ) |
|
◆ test_to_array_with_array()
ComponentHelperTest::test_to_array_with_array |
( |
| ) |
|
◆ test_to_array_with_int()
ComponentHelperTest::test_to_array_with_int |
( |
| ) |
|
◆ $mock
The documentation for this class was generated from the following file: