summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Tests
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-04-26 07:02:12 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-04-26 07:02:12 +0100
commit6a2416b2a351803acb53b4d61c3b75e01ef259b6 (patch)
treefe185c0377205abb9bd98b211b58a78fb631eba3 /vendor/symfony/cache/Tests
parent58654f783848d535923c92c043d49188036d8b08 (diff)
downloadwebtrees-6a2416b2a351803acb53b4d61c3b75e01ef259b6.tar.gz
webtrees-6a2416b2a351803acb53b4d61c3b75e01ef259b6.tar.bz2
webtrees-6a2416b2a351803acb53b4d61c3b75e01ef259b6.zip
Update vendor dependencies
Diffstat (limited to 'vendor/symfony/cache/Tests')
-rw-r--r--vendor/symfony/cache/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/symfony/cache/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php b/vendor/symfony/cache/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php
new file mode 100644
index 0000000000..b11c1f2870
--- /dev/null
+++ b/vendor/symfony/cache/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Symfony\Component\Cache\Tests\Adapter;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Cache\CacheItemPoolInterface;
+use Symfony\Component\Cache\Adapter\ArrayAdapter;
+use Symfony\Component\Cache\Adapter\ProxyAdapter;
+use Symfony\Component\Cache\Adapter\TagAwareAdapter;
+use Symfony\Component\Cache\Tests\Fixtures\ExternalAdapter;
+
+class TagAwareAndProxyAdapterIntegrationTest extends TestCase
+{
+ /**
+ * @dataProvider dataProvider
+ */
+ public function testIntegrationUsingProxiedAdapter(CacheItemPoolInterface $proxiedAdapter)
+ {
+ $cache = new TagAwareAdapter(new ProxyAdapter($proxiedAdapter));
+
+ $item = $cache->getItem('foo');
+ $item->tag(['tag1', 'tag2']);
+ $item->set('bar');
+ $cache->save($item);
+
+ $this->assertSame('bar', $cache->getItem('foo')->get());
+ }
+
+ public function dataProvider()
+ {
+ return [
+ [new ArrayAdapter()],
+ // also testing with a non-AdapterInterface implementation
+ // because the ProxyAdapter behaves slightly different for those
+ [new ExternalAdapter()],
+ ];
+ }
+}