ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\HTTP\Auth\BearerTest Class Reference
+ Inheritance diagram for Sabre\HTTP\Auth\BearerTest:
+ Collaboration diagram for Sabre\HTTP\Auth\BearerTest:

Public Member Functions

 testGetToken ()
 
 testGetCredentialsNoheader ()
 
 testGetCredentialsNotBearer ()
 
 testRequireLogin ()
 

Detailed Description

Definition at line 8 of file BearerTest.php.

Member Function Documentation

◆ testGetCredentialsNoheader()

Sabre\HTTP\Auth\BearerTest::testGetCredentialsNoheader ( )

Definition at line 25 of file BearerTest.php.

References $request.

25  {
26 
27  $request = new Request('GET', '/', []);
28  $bearer = new Bearer('Dagger', $request, new Response());
29 
30  $this->assertNull($bearer->getToken());
31 
32  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testGetCredentialsNotBearer()

Sabre\HTTP\Auth\BearerTest::testGetCredentialsNotBearer ( )

Definition at line 34 of file BearerTest.php.

References $request.

34  {
35 
36  $request = new Request('GET', '/', [
37  'Authorization' => 'QBearer 12345'
38  ]);
39  $bearer = new Bearer('Dagger', $request, new Response());
40 
41  $this->assertNull($bearer->getToken());
42 
43  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testGetToken()

Sabre\HTTP\Auth\BearerTest::testGetToken ( )

Definition at line 10 of file BearerTest.php.

References $request.

10  {
11 
12  $request = new Request('GET', '/', [
13  'Authorization' => 'Bearer 12345'
14  ]);
15 
16  $bearer = new Bearer('Dagger', $request, new Response());
17 
18  $this->assertEquals(
19  '12345',
20  $bearer->getToken()
21  );
22 
23  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testRequireLogin()

Sabre\HTTP\Auth\BearerTest::testRequireLogin ( )

Definition at line 45 of file BearerTest.php.

References $response.

45  {
46 
47  $response = new Response();
48  $bearer = new Bearer('Dagger', new Request(), $response);
49 
50  $bearer->requireLogin();
51 
52  $this->assertEquals('Bearer realm="Dagger"', $response->getHeader('WWW-Authenticate'));
53  $this->assertEquals(401, $response->getStatus());
54 
55  }
$response

The documentation for this class was generated from the following file: