ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BasicCallBackTest.php
Go to the documentation of this file.
1<?php
2
4
7
9
10 function testCallBack() {
11
12 $args = [];
13 $callBack = function($user, $pass) use (&$args) {
14
15 $args = [$user, $pass];
16 return true;
17
18 };
19
20 $backend = new BasicCallBack($callBack);
21
23 'HTTP_AUTHORIZATION' => 'Basic ' . base64_encode('foo:bar'),
24 ]);
25 $response = new Response();
26
27 $this->assertEquals(
28 [true, 'principals/foo'],
29 $backend->check($request, $response)
30 );
31
32 $this->assertEquals(['foo', 'bar'], $args);
33
34 }
35
36}
foreach($paths as $path) $request
Definition: asyncclient.php:32
An exception for terminatinating execution or to throw for unit testing.
Extremely simply HTTP Basic auth backend.
This class represents a single HTTP response.
Definition: Response.php:12
PHP SAPI.
Definition: Sapi.php:31
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$user
Definition: migrateto20.php:57
$response