diff options
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/ApacheTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/ApacheTest.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/ApacheTest.php b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/ApacheTest.php new file mode 100644 index 000000000..b1ed555d4 --- /dev/null +++ b/vendor/sabre/dav/tests/Sabre/DAV/Auth/Backend/ApacheTest.php @@ -0,0 +1,45 @@ +<?php + +namespace Sabre\DAV\Auth\Backend; + +use Sabre\DAV; +use Sabre\HTTP; + +class ApacheTest extends \PHPUnit_Framework_TestCase { + + function testConstruct() { + + $backend = new Apache(); + + } + + /** + * @expectedException Sabre\DAV\Exception + */ + function testNoHeader() { + + $server = new DAV\Server(); + $backend = new Apache(); + $backend->authenticate($server,'Realm'); + + } + + function testRemoteUser() { + + $backend = new Apache(); + + $server = new DAV\Server(); + $request = new HTTP\Request(array( + 'REMOTE_USER' => 'username', + )); + $server->httpRequest = $request; + + $this->assertTrue($backend->authenticate($server, 'Realm')); + + $userInfo = 'username'; + + $this->assertEquals($userInfo, $backend->getCurrentUser()); + + } + +} |