Lines Matching refs:request

33         $request = $this->createMock(ServerRequestInterface::class);
34 $request
38 self::assertSame('test', Validator::attributes($request)->string('param'));
43 $request = $this->createMock(ServerRequestInterface::class);
44 $request
48 self::assertSame('test', Validator::parsedBody($request)->string('param'));
53 $request = $this->createMock(ServerRequestInterface::class);
54 $request
58 self::assertSame('test', Validator::queryParams($request)->string('param'));
63 $request = $this->createMock(ServerRequestInterface::class);
64 $request
68 self::assertSame('test', Validator::serverParams($request)->string('param'));
73 $request = $this->createMock(ServerRequestInterface::class);
74 $request
80 Validator::queryParams($request);
85 $request = $this->createMock(ServerRequestInterface::class);
86 $request
92 Validator::queryParams($request);
97 $request = $this->createMock(ServerRequestInterface::class);
98 $request
102 self::assertSame(['test'], Validator::queryParams($request)->array('param'));
106 Validator::queryParams($request)->array('invalid');
111 $request = $this->createMock(ServerRequestInterface::class);
112 $request
123 self::assertTrue(Validator::queryParams($request)->boolean('a'));
124 self::assertTrue(Validator::queryParams($request)->boolean('b'));
125 self::assertTrue(Validator::queryParams($request)->boolean('c'));
126 self::assertFalse(Validator::queryParams($request)->boolean('d'));
127 self::assertFalse(Validator::queryParams($request)->boolean('e'));
128 self::assertFalse(Validator::queryParams($request)->boolean('f'));
129 self::assertFalse(Validator::queryParams($request)->boolean('g', false));
133 Validator::queryParams($request)->boolean('h');
138 $request = $this->createMock(ServerRequestInterface::class);
139 $request
149 self::assertSame(42, Validator::queryParams($request)->integer('int_type_positive'));
150 self::assertSame(-42, Validator::queryParams($request)->integer('int_type_negative'));
151 self::assertSame(42, Validator::queryParams($request)->integer('string_type_positive'));
152 self::assertSame(-42, Validator::queryParams($request)->integer('string_type_negative'));
156 Validator::queryParams($request)->integer('invalid');
163 $request = $this->createMock(ServerRequestInterface::class);
164 $request
171 self::assertSame($route, Validator::queryParams($request)->route('valid-route'));
175 Validator::queryParams($request)->route('not-route');
180 $request = $this->createMock(ServerRequestInterface::class);
181 $request
185 self::assertSame('test', Validator::queryParams($request)->string('param'));
189 Validator::queryParams($request)->string('invalid');
196 $request = $this->createMock(ServerRequestInterface::class);
197 $request
204 self::assertSame($tree, Validator::queryParams($request)->tree('valid-tree'));
208 Validator::queryParams($request)->tree('no-tree');
215 $request = $this->createMock(ServerRequestInterface::class);
216 $request
223 self::assertSame($tree, Validator::queryParams($request)->treeOptional('valid-tree'));
224 self::assertNull(Validator::queryParams($request)->treeOptional('missing-tree'));
228 Validator::queryParams($request)->treeOptional('not-tree');
235 $request = $this->createMock(ServerRequestInterface::class);
236 $request
243 self::assertSame($user, Validator::queryParams($request)->user('valid-user'));
247 Validator::queryParams($request)->user('not-user');
252 $request = $this->createMock(ServerRequestInterface::class);
253 $request
257 self::assertSame(42, Validator::queryParams($request)->isBetween(40, 45)->integer('param'));
258 … self::assertSame(42, Validator::queryParams($request)->isBetween(40, 45)->integer('invalid', 42));
259 …self::assertSame(42, Validator::queryParams($request)->isBetween(40, 45)->integer('wrongtype', 42)…
264 $request = $this->createMock(ServerRequestInterface::class);
265 $request
269 …self::assertSame('foo', Validator::queryParams($request)->isInArray(['foo', 'bar'])->string('param…
273 Validator::queryParams($request)->isInArray(['baz'])->string('param');
278 $request = $this->createMock(ServerRequestInterface::class);
279 $request
283 …self::assertSame('foo', Validator::queryParams($request)->isInArrayKeys(['foo' => 1, 'bar' => 2])-…
287 Validator::queryParams($request)->isInArrayKeys(['baz' => 3])->string('param');
292 $request = $this->createMock(ServerRequestInterface::class);
293 $request
297 … self::assertSame('foo', Validator::queryParams($request)->isNotEmpty()->string('not-empty'));
301 Validator::queryParams($request)->isNotEmpty()->string('empty');
306 $request = $this->createMock(ServerRequestInterface::class);
307 $request
311 self::assertSame('BIRT', Validator::queryParams($request)->isTag()->string('valid'));
315 Validator::queryParams($request)->isTag()->string('invalid');
320 $request = $this->createMock(ServerRequestInterface::class);
321 $request
325 self::assertSame('X1', Validator::queryParams($request)->isXref()->string('valid'));
326 self::assertSame(['X1'], Validator::queryParams($request)->isXref()->array('valid-array'));
327 self::assertSame([], Validator::queryParams($request)->isXref()->array('invalid-array'));
331 Validator::queryParams($request)->isXref()->string('invalid');
336 $request = $this->createMock(ServerRequestInterface::class);
337 $request
350 $request = $this->createMock(ServerRequestInterface::class);
351 $request
361 Validator::queryParams($request)->isLocalUrl()->string('https');
366 $request = $this->createMock(ServerRequestInterface::class);
367 $request
377 Validator::queryParams($request)->isLocalUrl()->string('invalid');
382 $request = $this->createMock(ServerRequestInterface::class);
383 $request
389 Validator::queryParams($request)->isLocalUrl()->isLocalUrl()->string('wrongtype');