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

Public Member Functions

 setUp ()
 
 testBaseClass ()
 
 testOptions ()
 
 testGetPlugin ()
 
 testUnknownPlugin ()
 
 testGetSupportedReportSet ()
 
 testGetPlugins ()
 
- Public Member Functions inherited from Sabre\DAV\AbstractServer
 setUp ()
 
 tearDown ()
 

Protected Attributes

 $testPlugin
 
- Protected Attributes inherited from Sabre\DAV\AbstractServer
 $response
 
 $request
 
 $server
 
 $tempDir = SABRE_TEMPDIR
 

Additional Inherited Members

- Protected Member Functions inherited from Sabre\DAV\AbstractServer
 getRootNode ()
 

Detailed Description

Definition at line 10 of file ServerPluginTest.php.

Member Function Documentation

◆ setUp()

Sabre\DAV\ServerPluginTest::setUp ( )

Definition at line 17 of file ServerPluginTest.php.

References Sabre\DAV\ServerPluginTest\$testPlugin.

17  {
18 
19  parent::setUp();
20 
21  $testPlugin = new TestPlugin();
22  $this->server->addPlugin($testPlugin);
23  $this->testPlugin = $testPlugin;
24 
25  }

◆ testBaseClass()

Sabre\DAV\ServerPluginTest::testBaseClass ( )

Definition at line 29 of file ServerPluginTest.php.

29  {
30 
31  $p = new ServerPluginMock();
32  $this->assertEquals([], $p->getFeatures());
33  $this->assertEquals([], $p->getHTTPMethods(''));
34  $this->assertEquals(
35  [
36  'name' => 'Sabre\DAV\ServerPluginMock',
37  'description' => null,
38  'link' => null
39  ], $p->getPluginInfo()
40  );
41 
42  }

◆ testGetPlugin()

Sabre\DAV\ServerPluginTest::testGetPlugin ( )

Definition at line 71 of file ServerPluginTest.php.

71  {
72 
73  $this->assertEquals($this->testPlugin, $this->server->getPlugin(get_class($this->testPlugin)));
74 
75  }

◆ testGetPlugins()

Sabre\DAV\ServerPluginTest::testGetPlugins ( )

Definition at line 89 of file ServerPluginTest.php.

89  {
90 
91  $this->assertEquals(
92  [
93  get_class($this->testPlugin) => $this->testPlugin,
94  'core' => $this->server->getPlugin('core'),
95  ],
96  $this->server->getPlugins()
97  );
98 
99  }

◆ testGetSupportedReportSet()

Sabre\DAV\ServerPluginTest::testGetSupportedReportSet ( )

Definition at line 83 of file ServerPluginTest.php.

83  {
84 
85  $this->assertEquals([], $this->testPlugin->getSupportedReportSet('/'));
86 
87  }

◆ testOptions()

Sabre\DAV\ServerPluginTest::testOptions ( )

Definition at line 44 of file ServerPluginTest.php.

References Sabre\DAV\AbstractServer\$request, Sabre\HTTP\Sapi\createFromServerArray(), and Sabre\DAV\Version\VERSION.

44  {
45 
46  $serverVars = [
47  'REQUEST_URI' => '/',
48  'REQUEST_METHOD' => 'OPTIONS',
49  ];
50 
52  $this->server->httpRequest = ($request);
53  $this->server->exec();
54 
55  $this->assertEquals([
56  'DAV' => ['1, 3, extended-mkcol, drinking'],
57  'MS-Author-Via' => ['DAV'],
58  'Allow' => ['OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT, BEER, WINE'],
59  'Accept-Ranges' => ['bytes'],
60  'Content-Length' => ['0'],
61  'X-Sabre-Version' => [Version::VERSION],
62  ], $this->response->getHeaders());
63 
64  $this->assertEquals(200, $this->response->status);
65  $this->assertEquals('', $this->response->body);
66  $this->assertEquals('OPTIONS', $this->testPlugin->beforeMethod);
67 
68 
69  }
const VERSION
Full version number.
Definition: Version.php:17
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
+ Here is the call graph for this function:

◆ testUnknownPlugin()

Sabre\DAV\ServerPluginTest::testUnknownPlugin ( )

Definition at line 77 of file ServerPluginTest.php.

77  {
78 
79  $this->assertNull($this->server->getPlugin('SomeRandomClassName'));
80 
81  }

Field Documentation

◆ $testPlugin

Sabre\DAV\ServerPluginTest::$testPlugin
protected

Definition at line 15 of file ServerPluginTest.php.

Referenced by Sabre\DAV\ServerPluginTest\setUp().


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