[TASK] Add test for timeout of WebDAV driver
authorAndreas Wolf <andreas.wolf@typo3.org>
Sat, 14 Apr 2012 10:22:06 +0000 (12:22 +0200)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sat, 14 Apr 2012 10:22:06 +0000 (12:22 +0200)
Tests/Driver/WebDavDriverTest.php

index 7ab57da..0099c19 100644 (file)
@@ -212,4 +212,17 @@ class Tx_FalWebdav_Driver_WebDavDriverTest extends t3lib_file_BaseTestCase {
 
                $this->fixture->deleteFolder($mockedFolder);
        }
+
+       /**
+        * @test
+        */
+       public function timeoutOnRequestThrowsException() {
+               $this->setExpectedException('Sabre_DAV_Exception_Timeout');
+
+                       // 192.0.2.0/24 is a network that should be used in documentation and for tests, but not in the wild;
+                       // see http://tools.ietf.org/html/rfc5737
+               $client = new Sabre_DAV_Client(array('baseUri' => 'http://192.0.2.1/', 'timeout' => 5));
+
+               print_r($client->request('GET', '/something'));
+       }
 }