◆ setUp()
ComponentHelperTest::setUp |
( |
| ) |
|
◆ testCheckArgInstanceofNotOk()
ComponentHelperTest::testCheckArgInstanceofNotOk |
( |
| ) |
|
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);
◆ testCheckArgInstanceofOk()
ComponentHelperTest::testCheckArgInstanceofOk |
( |
| ) |
|
Definition at line 152 of file ComponentHelperTest.php.
154 $this->mock->_checkArgInstanceOf(
"some_arg", $this->mock, ComponentMock::class);
◆ testCheckArgIsElementOk()
ComponentHelperTest::testCheckArgIsElementOk |
( |
| ) |
|
Definition at line 168 of file ComponentHelperTest.php.
170 $this->mock->_checkArgIsElement(
"some_arg",
"bar", array(
"foo",
"bar"),
"foobar");
◆ testCheckArgListElementsMultiClassNotOk()
ComponentHelperTest::testCheckArgListElementsMultiClassNotOk |
( |
| ) |
|
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"));
◆ testCheckArgListElementsMultiClassOk()
ComponentHelperTest::testCheckArgListElementsMultiClassOk |
( |
| ) |
|
Definition at line 215 of file ComponentHelperTest.php.
218 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"Class1",
"Class2"));
◆ testCheckArgListElementsNoOk()
ComponentHelperTest::testCheckArgListElementsNoOk |
( |
| ) |
|
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"));
◆ testCheckArgListElementsOk()
ComponentHelperTest::testCheckArgListElementsOk |
( |
| ) |
|
◆ testCheckArgListElementsStringOrIntNotOk()
ComponentHelperTest::testCheckArgListElementsStringOrIntNotOk |
( |
| ) |
|
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"));
◆ testCheckArgListElementsStringOrIntOk()
ComponentHelperTest::testCheckArgListElementsStringOrIntOk |
( |
| ) |
|
Definition at line 232 of file ComponentHelperTest.php.
234 $l = array(1,
"foo");
235 $this->mock->_checkArgListElements(
"some_arg", $l, array(
"string",
"int"));
◆ testCheckArgListNotOk1()
ComponentHelperTest::testCheckArgListNotOk1 |
( |
| ) |
|
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)";
◆ testCheckArgListNotOk2()
ComponentHelperTest::testCheckArgListNotOk2 |
( |
| ) |
|
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)";
◆ testCheckArgListOk()
ComponentHelperTest::testCheckArgListOk |
( |
| ) |
|
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)";
◆ testCheckArgNotOk()
ComponentHelperTest::testCheckArgNotOk |
( |
| ) |
|
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");
◆ testCheckArgOk()
ComponentHelperTest::testCheckArgOk |
( |
| ) |
|
◆ testCheckBoolArgNotOk()
ComponentHelperTest::testCheckBoolArgNotOk |
( |
| ) |
|
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);
◆ testCheckBoolArgOk()
ComponentHelperTest::testCheckBoolArgOk |
( |
| ) |
|
◆ testCheckStringArgIsElementNotOk()
ComponentHelperTest::testCheckStringArgIsElementNotOk |
( |
| ) |
|
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");
◆ testCheckStringArgNotOk()
ComponentHelperTest::testCheckStringArgNotOk |
( |
| ) |
|
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);
◆ testCheckStringArgOk()
ComponentHelperTest::testCheckStringArgOk |
( |
| ) |
|
◆ testGetCanonicalName()
ComponentHelperTest::testGetCanonicalName |
( |
| ) |
|
◆ testToArrayWithArray()
ComponentHelperTest::testToArrayWithArray |
( |
| ) |
|
◆ testToArrayWithInt()
ComponentHelperTest::testToArrayWithInt |
( |
| ) |
|
◆ $mock
The documentation for this class was generated from the following file: