Class WrapperTest.
More...
◆ setUp()
| array array array ILIAS\HTTP\WrapperTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 35 of file WrapperTest.php.
References ILIAS\Repository\refinery().
38 $language = $this->getMockBuilder(
'\ilLanguage')
39 ->disableOriginalConstructor()
Interface Observer Contains several chained tasks and infos about them.
◆ 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'));
135 $this->assertEquals([
'key_one',
'key_two'],
$cookie->keys());
137 $string_trafo = $this->
refinery->kindlyTo()->string();
138 $int_trafo = $this->
refinery->kindlyTo()->int();
140 $this->assertEquals(
"1",
$cookie->retrieve(
'key_one', $string_trafo));
141 $this->assertIsString(
$cookie->retrieve(
'key_one', $string_trafo));
143 $this->assertEquals(1,
$cookie->retrieve(
'key_one', $string_trafo));
144 $this->assertIsInt(
$cookie->retrieve(
'key_one', $int_trafo));
array array array $cookie
◆ testPost()
| ILIAS\HTTP\WrapperTest::testPost |
( |
| ) |
|
Definition at line 97 of file WrapperTest.php.
References ILIAS\Repository\refinery().
99 $wrapper_factory =
new WrapperFactory($this->request_interface);
101 $this->request_interface->expects($this->once())
102 ->method(
'getParsedBody')
103 ->willReturn($this->post);
105 $post = $wrapper_factory->post();
107 $this->assertTrue(
$post->has(
'key_one'));
108 $this->assertTrue(
$post->has(
'key_two'));
109 $this->assertFalse(
$post->has(
'key_three'));
110 $this->assertEquals([
'key_one',
'key_two'],
$post->keys());
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 72 of file WrapperTest.php.
References ILIAS\Repository\refinery().
74 $wrapper_factory =
new WrapperFactory($this->request_interface);
76 $this->request_interface->expects($this->once())
77 ->method(
'getQueryParams')
78 ->willReturn($this->
get);
80 $query = $wrapper_factory->query();
82 $this->assertTrue($query->has(
'key_one'));
83 $this->assertTrue($query->has(
'key_two'));
84 $this->assertFalse($query->has(
'key_three'));
85 $this->assertEquals([
'key_one',
'key_two'], $query->keys());
87 $string_trafo = $this->
refinery->kindlyTo()->string();
88 $int_trafo = $this->
refinery->kindlyTo()->int();
90 $this->assertEquals(
"1", $query->retrieve(
'key_one', $string_trafo));
91 $this->assertIsString($query->retrieve(
'key_one', $string_trafo));
93 $this->assertEquals(1, $query->retrieve(
'key_one', $string_trafo));
94 $this->assertIsInt($query->retrieve(
'key_one', $int_trafo));
◆ testWrapperfactory()
| ILIAS\HTTP\WrapperTest::testWrapperfactory |
( |
| ) |
|
Definition at line 46 of file WrapperTest.php.
48 $wrapper_factory =
new WrapperFactory($this->request_interface);
51 $this->request_interface->expects($this->once())
52 ->method(
'getQueryParams')
55 $wrapper_factory->query();
58 $this->request_interface->expects($this->once())
59 ->method(
'getParsedBody')
62 $wrapper_factory->post();
65 $this->request_interface->expects($this->once())
66 ->method(
'getCookieParams')
69 $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: