diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-11 05:54:20 -0400 |
commit | d968fc51eab8b0fb259ecbeae517056b99554017 (patch) | |
tree | 10e551cff9fefbefbfd7e5031b57320116bb7fce /vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php | |
parent | c7698e4dc388b7d9a9db368672cb057c1d4d3a01 (diff) | |
parent | 4dd3839c41e18d9724855e7955d8737b6f52dcd6 (diff) | |
download | volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.gz volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.tar.bz2 volse-hubzilla-d968fc51eab8b0fb259ecbeae517056b99554017.zip |
Merge remote-tracking branch 'upstream/dev' into plugin-repo
Diffstat (limited to 'vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php')
-rw-r--r-- | vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php b/vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php deleted file mode 100644 index 47a7b98bd..000000000 --- a/vendor/sabre/dav/tests/Sabre/HTTP/UtilTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Sabre\HTTP; - -class UtilTest extends \PHPUnit_Framework_TestCase { - - function testParseHTTPDate() { - - $times = array( - 'Wed, 13 Oct 2010 10:26:00 GMT', - 'Wednesday, 13-Oct-10 10:26:00 GMT', - 'Wed Oct 13 10:26:00 2010', - ); - - $expected = 1286965560; - - foreach($times as $time) { - $result = Util::parseHTTPDate($time); - $this->assertEquals($expected, $result->format('U')); - } - - $result = Util::parseHTTPDate('Wed Oct 6 10:26:00 2010'); - $this->assertEquals(1286360760, $result->format('U')); - - } - - function testParseHTTPDateFail() { - - $times = array( - //random string - 'NOW', - // not-GMT timezone - 'Wednesday, 13-Oct-10 10:26:00 UTC', - // No space before the 6 - 'Wed Oct 6 10:26:00 2010', - ); - - foreach($times as $time) { - $this->assertFalse(Util::parseHTTPDate($time), 'We used the string: ' . $time); - } - - } - - function testTimezones() { - - $default = date_default_timezone_get(); - date_default_timezone_set('Europe/Amsterdam'); - - $this->testParseHTTPDate(); - - date_default_timezone_set($default); - - } - - function testToHTTPDate() { - - $dt = new \DateTime('2011-12-10 12:00:00 +0200'); - - $this->assertEquals( - 'Sat, 10 Dec 2011 10:00:00 GMT', - Util::toHTTPDate($dt) - ); - - } - - function testStrtotimeFail() { - - // Strtotime may return -1 when the date cannot be parsed. - // We are simulating this situation by testing a date that actually - // results in -1. (because I have found no other way to break this - // code) - - $time = 'Wed, 13 Oct 1960 10:26:00 GMT'; - - $this->assertNull(Util::parseHTTPDate($time)); - - } -} |