aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/TestPlugin.php
blob: 619ac03fd73474ae8e0b38a8bdc1297642bac336 (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
<?php

namespace Sabre\DAV;

use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;

class TestPlugin extends ServerPlugin {

    public $beforeMethod;

    function getFeatures() {

        return ['drinking'];

    }

    function getHTTPMethods($uri) {

        return ['BEER','WINE'];

    }

    function initialize(Server $server) {

        $server->on('beforeMethod', [$this, 'beforeMethod']);

    }

    function beforeMethod(RequestInterface $request, ResponseInterface $response) {

        $this->beforeMethod = $request->getMethod();
        return true;

    }

}