summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Tests
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-06-22 21:23:30 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-06-22 21:25:44 +0100
commit50b23b0d007a750c2e92c88071f2224cb81db10e (patch)
tree198acc94e55214451e0975bfd410b082f1ef6df5 /vendor/symfony/cache/Tests
parent875080585841996f3fd1f780503fec8c397e750c (diff)
downloadwebtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.tar.gz
webtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.tar.bz2
webtrees-50b23b0d007a750c2e92c88071f2224cb81db10e.zip
Fix: #2359 - updated language negotiation for chinese in fisharebest/localization
Diffstat (limited to 'vendor/symfony/cache/Tests')
-rw-r--r--vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php19
-rw-r--r--vendor/symfony/cache/Tests/Adapter/ChainAdapterTest.php4
-rw-r--r--vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php4
-rw-r--r--vendor/symfony/cache/Tests/Simple/ChainCacheTest.php4
4 files changed, 25 insertions, 6 deletions
diff --git a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php
index 2b66d2bea0..93318ffd48 100644
--- a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php
+++ b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php
@@ -12,9 +12,12 @@
namespace Symfony\Component\Cache\Tests\Adapter;
use Cache\IntegrationTests\CachePoolTest;
+use PHPUnit\Framework\Assert;
+use Psr\Cache\CacheItemInterface;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\CacheItem;
use Symfony\Component\Cache\PruneableInterface;
+use Symfony\Contracts\Cache\CallbackInterface;
abstract class AdapterTestCase extends CachePoolTest
{
@@ -57,6 +60,22 @@ abstract class AdapterTestCase extends CachePoolTest
$this->assertSame($value, $item->get());
}, INF));
$this->assertFalse($isHit);
+
+ $this->assertSame($value, $cache->get('bar', new class($value) implements CallbackInterface {
+ private $value;
+
+ public function __construct(int $value)
+ {
+ $this->value = $value;
+ }
+
+ public function __invoke(CacheItemInterface $item, bool &$save)
+ {
+ Assert::assertSame('bar', $item->getKey());
+
+ return $this->value;
+ }
+ }));
}
public function testRecursiveGet()
diff --git a/vendor/symfony/cache/Tests/Adapter/ChainAdapterTest.php b/vendor/symfony/cache/Tests/Adapter/ChainAdapterTest.php
index 61b039b57b..46bbef4c31 100644
--- a/vendor/symfony/cache/Tests/Adapter/ChainAdapterTest.php
+++ b/vendor/symfony/cache/Tests/Adapter/ChainAdapterTest.php
@@ -84,7 +84,7 @@ class ChainAdapterTest extends AdapterTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(true));
+ ->willReturn(true);
return $pruneable;
}
@@ -101,7 +101,7 @@ class ChainAdapterTest extends AdapterTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(false));
+ ->willReturn(false);
return $pruneable;
}
diff --git a/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php b/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php
index a339790862..2a0266ef56 100644
--- a/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php
+++ b/vendor/symfony/cache/Tests/Adapter/TagAwareAdapterTest.php
@@ -76,7 +76,7 @@ class TagAwareAdapterTest extends AdapterTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(true));
+ ->willReturn(true);
return $pruneable;
}
@@ -93,7 +93,7 @@ class TagAwareAdapterTest extends AdapterTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(false));
+ ->willReturn(false);
return $pruneable;
}
diff --git a/vendor/symfony/cache/Tests/Simple/ChainCacheTest.php b/vendor/symfony/cache/Tests/Simple/ChainCacheTest.php
index 806bb7633b..0af56cd30d 100644
--- a/vendor/symfony/cache/Tests/Simple/ChainCacheTest.php
+++ b/vendor/symfony/cache/Tests/Simple/ChainCacheTest.php
@@ -79,7 +79,7 @@ class ChainCacheTest extends CacheTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(true));
+ ->willReturn(true);
return $pruneable;
}
@@ -96,7 +96,7 @@ class ChainCacheTest extends CacheTestCase
$pruneable
->expects($this->atLeastOnce())
->method('prune')
- ->will($this->returnValue(false));
+ ->willReturn(false);
return $pruneable;
}