"Fossies" - the Fresh Open Source Software Archive

Member "dav-4.0.3/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php" (10 Jan 2020, 1125 Bytes) of package /linux/www/dav-4.0.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "MapGetToPropFindTest.php": 4.0.2_vs_4.0.3.

    1 <?php
    2 
    3 declare(strict_types=1);
    4 
    5 namespace Sabre\DAV\Browser;
    6 
    7 use Sabre\DAV;
    8 use Sabre\HTTP;
    9 
   10 require_once 'Sabre/DAV/AbstractServer.php';
   11 
   12 class MapGetToPropFindTest extends DAV\AbstractServer
   13 {
   14     public function setUp()
   15     {
   16         parent::setUp();
   17         $this->server->addPlugin(new MapGetToPropFind());
   18     }
   19 
   20     public function testCollectionGet()
   21     {
   22         $serverVars = [
   23             'REQUEST_URI' => '/',
   24             'REQUEST_METHOD' => 'GET',
   25         ];
   26 
   27         $request = HTTP\Sapi::createFromServerArray($serverVars);
   28         $request->setBody('');
   29         $this->server->httpRequest = ($request);
   30         $this->server->exec();
   31 
   32         $this->assertEquals(207, $this->response->status, 'Incorrect status response received. Full response body: '.$this->response->getBodyAsString());
   33         $this->assertEquals([
   34             'X-Sabre-Version' => [DAV\Version::VERSION],
   35             'Content-Type' => ['application/xml; charset=utf-8'],
   36             'DAV' => ['1, 3, extended-mkcol'],
   37             'Vary' => ['Brief,Prefer'],
   38             ],
   39             $this->response->getHeaders()
   40          );
   41     }
   42 }