Class WrapperTest.
More...
◆ setUp()
array array array ILIAS\HTTP\WrapperTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 39 of file WrapperTest.php.
References ILIAS\Repository\refinery().
42 $language = $this->getMockBuilder(
'\ilLanguage')
43 ->disableOriginalConstructor()
Interface Observer Contains several chained tasks and infos about them.
◆ testCookie()
ILIAS\HTTP\WrapperTest::testCookie |
( |
| ) |
|
Definition at line 126 of file WrapperTest.php.
References ILIAS\Repository\refinery().
128 $wrapper_factory =
new WrapperFactory($this->request_interface);
130 $this->request_interface->expects($this->once())
131 ->method(
'getCookieParams')
132 ->willReturn($this->cookie);
134 $cookie = $wrapper_factory->cookie();
136 $this->assertTrue(
$cookie->has(
'key_one'));
137 $this->assertTrue(
$cookie->has(
'key_two'));
138 $this->assertFalse(
$cookie->has(
'key_three'));
139 $this->assertEquals([
'key_one',
'key_two'],
$cookie->keys());
141 $string_trafo = $this->
refinery->kindlyTo()->string();
142 $int_trafo = $this->
refinery->kindlyTo()->int();
144 $this->assertEquals(
"1",
$cookie->retrieve(
'key_one', $string_trafo));
145 $this->assertIsString(
$cookie->retrieve(
'key_one', $string_trafo));
147 $this->assertEquals(1,
$cookie->retrieve(
'key_one', $string_trafo));
148 $this->assertIsInt(
$cookie->retrieve(
'key_one', $int_trafo));
array array array $cookie
◆ testPost()
ILIAS\HTTP\WrapperTest::testPost |
( |
| ) |
|
Definition at line 101 of file WrapperTest.php.
References ILIAS\Repository\refinery().
103 $wrapper_factory =
new WrapperFactory($this->request_interface);
105 $this->request_interface->expects($this->once())
106 ->method(
'getParsedBody')
107 ->willReturn($this->post);
109 $post = $wrapper_factory->post();
111 $this->assertTrue(
$post->has(
'key_one'));
112 $this->assertTrue(
$post->has(
'key_two'));
113 $this->assertFalse(
$post->has(
'key_three'));
114 $this->assertEquals([
'key_one',
'key_two'],
$post->keys());
116 $string_trafo = $this->
refinery->kindlyTo()->string();
117 $int_trafo = $this->
refinery->kindlyTo()->int();
119 $this->assertEquals(
"1",
$post->retrieve(
'key_one', $string_trafo));
120 $this->assertIsString(
$post->retrieve(
'key_one', $string_trafo));
122 $this->assertEquals(1,
$post->retrieve(
'key_one', $string_trafo));
123 $this->assertIsInt(
$post->retrieve(
'key_one', $int_trafo));
◆ testQuery()
ILIAS\HTTP\WrapperTest::testQuery |
( |
| ) |
|
Definition at line 76 of file WrapperTest.php.
References ILIAS\Repository\refinery().
78 $wrapper_factory =
new WrapperFactory($this->request_interface);
80 $this->request_interface->expects($this->once())
81 ->method(
'getQueryParams')
82 ->willReturn($this->
get);
84 $query = $wrapper_factory->query();
86 $this->assertTrue($query->has(
'key_one'));
87 $this->assertTrue($query->has(
'key_two'));
88 $this->assertFalse($query->has(
'key_three'));
89 $this->assertEquals([
'key_one',
'key_two'], $query->keys());
91 $string_trafo = $this->
refinery->kindlyTo()->string();
92 $int_trafo = $this->
refinery->kindlyTo()->int();
94 $this->assertEquals(
"1", $query->retrieve(
'key_one', $string_trafo));
95 $this->assertIsString($query->retrieve(
'key_one', $string_trafo));
97 $this->assertEquals(1, $query->retrieve(
'key_one', $string_trafo));
98 $this->assertIsInt($query->retrieve(
'key_one', $int_trafo));
◆ testWrapperfactory()
ILIAS\HTTP\WrapperTest::testWrapperfactory |
( |
| ) |
|
Definition at line 50 of file WrapperTest.php.
52 $wrapper_factory =
new WrapperFactory($this->request_interface);
55 $this->request_interface->expects($this->once())
56 ->method(
'getQueryParams')
59 $wrapper_factory->query();
62 $this->request_interface->expects($this->once())
63 ->method(
'getParsedBody')
66 $wrapper_factory->post();
69 $this->request_interface->expects($this->once())
70 ->method(
'getCookieParams')
73 $wrapper_factory->cookie();
◆ $cookie
array array array ILIAS\HTTP\WrapperTest::$cookie = ['key_one' => 1 |
|
protected |
◆ $get
array ILIAS\HTTP\WrapperTest::$get = ['key_one' => 1 |
|
protected |
◆ $post
array array ILIAS\HTTP\WrapperTest::$post = ['key_one' => 1 |
|
protected |
◆ $refinery
Factory ILIAS\HTTP\WrapperTest::$refinery |
|
protected |
The documentation for this class was generated from the following file: