mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-27 01:12:46 +00:00
31 lines
568 B
PHP
31 lines
568 B
PHP
|
<?php
|
||
|
|
||
|
namespace Sabre\DAV;
|
||
|
|
||
|
class ExceptionTest extends \PHPUnit_Framework_TestCase {
|
||
|
|
||
|
function testStatus() {
|
||
|
|
||
|
$e = new Exception();
|
||
|
$this->assertEquals(500,$e->getHTTPCode());
|
||
|
|
||
|
}
|
||
|
|
||
|
function testExceptionStatuses() {
|
||
|
|
||
|
$c = array(
|
||
|
'Sabre\\DAV\\Exception\\NotAuthenticated' => 401,
|
||
|
'Sabre\\DAV\\Exception\\InsufficientStorage' => 507,
|
||
|
);
|
||
|
|
||
|
foreach($c as $class=>$status) {
|
||
|
|
||
|
$obj = new $class();
|
||
|
$this->assertEquals($status, $obj->getHTTPCode());
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|