aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
blob: de7b85f32e8e46b49b49c8897cf6de573c9b4713 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

declare(strict_types=1);

namespace Sabre\DAV\Browser;

use Sabre\DAV;
use Sabre\HTTP;

require_once 'Sabre/DAV/AbstractServer.php';

class MapGetToPropFindTest extends DAV\AbstractServer
{
    public function setUp()
    {
        parent::setUp();
        $this->server->addPlugin(new MapGetToPropFind());
    }

    public function testCollectionGet()
    {
        $serverVars = [
            'REQUEST_URI' => '/',
            'REQUEST_METHOD' => 'GET',
        ];

        $request = HTTP\Sapi::createFromServerArray($serverVars);
        $request->setBody('');
        $this->server->httpRequest = ($request);
        $this->server->exec();

        $this->assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: '.$this->response->body);
        $this->assertEquals([
            'X-Sabre-Version' => [DAV\Version::VERSION],
            'Content-Type' => ['application/xml; charset=utf-8'],
            'DAV' => ['1, 3, extended-mkcol'],
            'Vary' => ['Brief,Prefer'],
            ],
            $this->response->getHeaders()
         );
    }
}