Class WrapperTest.
More...
◆ setUp()
array array array ILIAS\HTTP\WrapperTest::setUp |
( |
| ) |
|
|
protected |
◆ testCookie()
ILIAS\HTTP\WrapperTest::testCookie |
( |
| ) |
|
Definition at line 122 of file WrapperTest.php.
References ILIAS\Repository\refinery().
124 $wrapper_factory =
new WrapperFactory($this->request_interface);
126 $this->request_interface->expects($this->once())
127 ->method(
'getCookieParams')
128 ->willReturn($this->cookie);
130 $cookie = $wrapper_factory->cookie();
132 $this->assertTrue(
$cookie->has(
'key_one'));
133 $this->assertTrue(
$cookie->has(
'key_two'));
134 $this->assertFalse(
$cookie->has(
'key_three'));
136 $string_trafo = $this->
refinery->kindlyTo()->string();
137 $int_trafo = $this->
refinery->kindlyTo()->int();
139 $this->assertEquals(
"1",
$cookie->retrieve(
'key_one', $string_trafo));
140 $this->assertIsString(
$cookie->retrieve(
'key_one', $string_trafo));
142 $this->assertEquals(1,
$cookie->retrieve(
'key_one', $string_trafo));
143 $this->assertIsInt(
$cookie->retrieve(
'key_one', $int_trafo));
array array array $cookie
◆ testPost()
ILIAS\HTTP\WrapperTest::testPost |
( |
| ) |
|
Definition at line 98 of file WrapperTest.php.
References ILIAS\Repository\refinery().
100 $wrapper_factory =
new WrapperFactory($this->request_interface);
102 $this->request_interface->expects($this->once())
103 ->method(
'getParsedBody')
104 ->willReturn($this->post);
106 $post = $wrapper_factory->post();
108 $this->assertTrue(
$post->has(
'key_one'));
109 $this->assertTrue(
$post->has(
'key_two'));
110 $this->assertFalse(
$post->has(
'key_three'));
112 $string_trafo = $this->
refinery->kindlyTo()->string();
113 $int_trafo = $this->
refinery->kindlyTo()->int();
115 $this->assertEquals(
"1",
$post->retrieve(
'key_one', $string_trafo));
116 $this->assertIsString(
$post->retrieve(
'key_one', $string_trafo));
118 $this->assertEquals(1,
$post->retrieve(
'key_one', $string_trafo));
119 $this->assertIsInt(
$post->retrieve(
'key_one', $int_trafo));
◆ testQuery()
ILIAS\HTTP\WrapperTest::testQuery |
( |
| ) |
|
Definition at line 74 of file WrapperTest.php.
References $query, and ILIAS\Repository\refinery().
76 $wrapper_factory =
new WrapperFactory($this->request_interface);
78 $this->request_interface->expects($this->once())
79 ->method(
'getQueryParams')
80 ->willReturn($this->
get);
82 $query = $wrapper_factory->query();
84 $this->assertTrue(
$query->has(
'key_one'));
85 $this->assertTrue(
$query->has(
'key_two'));
86 $this->assertFalse(
$query->has(
'key_three'));
88 $string_trafo = $this->
refinery->kindlyTo()->string();
89 $int_trafo = $this->
refinery->kindlyTo()->int();
91 $this->assertEquals(
"1",
$query->retrieve(
'key_one', $string_trafo));
92 $this->assertIsString(
$query->retrieve(
'key_one', $string_trafo));
94 $this->assertEquals(1,
$query->retrieve(
'key_one', $string_trafo));
95 $this->assertIsInt(
$query->retrieve(
'key_one', $int_trafo));
◆ testWrapperfactory()
ILIAS\HTTP\WrapperTest::testWrapperfactory |
( |
| ) |
|
Definition at line 48 of file WrapperTest.php.
50 $wrapper_factory =
new WrapperFactory($this->request_interface);
53 $this->request_interface->expects($this->once())
54 ->method(
'getQueryParams')
57 $wrapper_factory->query();
60 $this->request_interface->expects($this->once())
61 ->method(
'getParsedBody')
64 $wrapper_factory->post();
67 $this->request_interface->expects($this->once())
68 ->method(
'getCookieParams')
71 $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: