28 protected array
$get = [
'key_one' => 1,
'key_two' => 2];
29 protected array
$post = [
'key_one' => 1,
'key_two' => 2];
30 protected array
$cookie = [
'key_one' => 1,
'key_two' => 2];
35 protected function setUp(): void
38 $language = $this->getMockBuilder(
'\ilLanguage')
39 ->disableOriginalConstructor()
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();
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));
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));
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));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array array array $cookie
Interface Observer Contains several chained tasks and infos about them.
array array array setUp()