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

Public Member Functions

 testGetCredentials ()
 
 testGetInvalidCredentialsColonMissing ()
 
 testGetCredentialsNoheader ()
 
 testGetCredentialsNotBasic ()
 
 testRequireLogin ()
 

Detailed Description

Definition at line 8 of file BasicTest.php.

Member Function Documentation

◆ testGetCredentials()

Sabre\HTTP\Auth\BasicTest::testGetCredentials ( )

Definition at line 10 of file BasicTest.php.

References $request.

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

◆ testGetCredentialsNoheader()

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

Definition at line 37 of file BasicTest.php.

References $request.

37  {
38 
39  $request = new Request('GET', '/', []);
40  $basic = new Basic('Dagger', $request, new Response());
41 
42  $this->assertNull($basic->getCredentials());
43 
44  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testGetCredentialsNotBasic()

Sabre\HTTP\Auth\BasicTest::testGetCredentialsNotBasic ( )

Definition at line 46 of file BasicTest.php.

References $request.

46  {
47 
48  $request = new Request('GET', '/', [
49  'Authorization' => 'QBasic ' . base64_encode('user:pass:bla')
50  ]);
51  $basic = new Basic('Dagger', $request, new Response());
52 
53  $this->assertNull($basic->getCredentials());
54 
55  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testGetInvalidCredentialsColonMissing()

Sabre\HTTP\Auth\BasicTest::testGetInvalidCredentialsColonMissing ( )

Definition at line 25 of file BasicTest.php.

References $request.

25  {
26 
27  $request = new Request('GET', '/', [
28  'Authorization' => 'Basic ' . base64_encode('userpass')
29  ]);
30 
31  $basic = new Basic('Dagger', $request, new Response());
32 
33  $this->assertNull($basic->getCredentials());
34 
35  }
foreach($paths as $path) $request
Definition: asyncclient.php:32

◆ testRequireLogin()

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

Definition at line 57 of file BasicTest.php.

References $response.

57  {
58 
59  $response = new Response();
60  $basic = new Basic('Dagger', new Request(), $response);
61 
62  $basic->requireLogin();
63 
64  $this->assertEquals('Basic realm="Dagger", charset="UTF-8"', $response->getHeader('WWW-Authenticate'));
65  $this->assertEquals(401, $response->getStatus());
66 
67  }
$response

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