diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
commit | 5697f7c92cbc7b2c23d2a8c6ba3d904734dd0739 (patch) | |
tree | d9c7d8cf5b7a42d505ceb06d63a9e00fa212daf8 /vendor/fguillot/picofeed/tests/Client | |
parent | d2d16c4c26f8f9a7ee97350e5cba5c3554c51013 (diff) |
udpate picofeed
Diffstat (limited to 'vendor/fguillot/picofeed/tests/Client')
-rw-r--r-- | vendor/fguillot/picofeed/tests/Client/ClientTest.php | 17 | ||||
-rw-r--r-- | vendor/fguillot/picofeed/tests/Client/HttpHeadersTest.php | 19 |
2 files changed, 36 insertions, 0 deletions
diff --git a/vendor/fguillot/picofeed/tests/Client/ClientTest.php b/vendor/fguillot/picofeed/tests/Client/ClientTest.php index 0a480c5c0..3f094d04c 100644 --- a/vendor/fguillot/picofeed/tests/Client/ClientTest.php +++ b/vendor/fguillot/picofeed/tests/Client/ClientTest.php @@ -18,16 +18,33 @@ class ClientTest extends PHPUnit_Framework_TestCase $this->assertNotEmpty($client->getLastModified()); } + public function testCacheBothHaveToMatch() + { + $client = Client::getInstance(); + $client->setUrl('http://php.net/robots.txt'); + $client->execute(); + $etag = $client->getEtag(); + + $client = Client::getInstance(); + $client->setUrl('http://php.net/robots.txt'); + $client->setEtag($etag); + $client->execute(); + + $this->assertTrue($client->isModified()); + } + public function testCacheEtag() { $client = Client::getInstance(); $client->setUrl('http://php.net/robots.txt'); $client->execute(); $etag = $client->getEtag(); + $lastModified = $client->getLastModified(); $client = Client::getInstance(); $client->setUrl('http://php.net/robots.txt'); $client->setEtag($etag); + $client->setLastModified($lastModified); $client->execute(); $this->assertFalse($client->isModified()); diff --git a/vendor/fguillot/picofeed/tests/Client/HttpHeadersTest.php b/vendor/fguillot/picofeed/tests/Client/HttpHeadersTest.php new file mode 100644 index 000000000..f577d00fa --- /dev/null +++ b/vendor/fguillot/picofeed/tests/Client/HttpHeadersTest.php @@ -0,0 +1,19 @@ +<?php +namespace PicoFeed\Client; + +use PHPUnit_Framework_TestCase; + + +class HttpHeadersTest extends PHPUnit_Framework_TestCase +{ + + public function testHttpHeadersSet() { + $headers = new HttpHeaders(array('Content-Type' => 'test')); + $this->assertEquals('test', $headers['content-typE']); + $this->assertTrue(isset($headers['ConTent-Type'])); + + unset($headers['Content-Type']); + $this->assertFalse(isset($headers['ConTent-Type'])); + } + +}
\ No newline at end of file |