aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/ExceptionTest.php
blob: 7237aea0d4f1829b30abc0006fbc9e04657f3fc7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

     
                        
 
                    
 



                                                       
                             
                                                    

     

                                           
              
                                                             
                                                                
          
 
                                           

                                                              
         
     
 
<?php

declare(strict_types=1);

namespace Sabre\DAV;

class ExceptionTest extends \PHPUnit\Framework\TestCase
{
    public function testStatus()
    {
        $e = new Exception();
        $this->assertEquals(500, $e->getHTTPCode());
    }

    public function testExceptionStatuses()
    {
        $c = [
            'Sabre\\DAV\\Exception\\NotAuthenticated' => 401,
            'Sabre\\DAV\\Exception\\InsufficientStorage' => 507,
        ];

        foreach ($c as $class => $status) {
            $obj = new $class();
            $this->assertEquals($status, $obj->getHTTPCode());
        }
    }
}