8000 [Cache] Fix CouchbaseCollectionAdapterTest · symfony/symfony@817420f · GitHub
[go: up one dir, main page]

Skip to content

Commit 817420f

Browse files
committed
[Cache] Fix CouchbaseCollectionAdapterTest
1 parent 4bf657a commit 817420f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
118118
return MemcachedAdapter::createConnection($dsn, $options);
119119
}
120120
if (str_starts_with($dsn, 'couchbase:')) {
121-
if (CouchbaseBucketAdapter::isSupported()) {
121+
if (class_exists('CouchbaseBucket') && CouchbaseBucketAdapter::isSupported()) {
122122
return CouchbaseBucketAdapter::createConnection($dsn, $options);
123123
}
124124

src/Symfony/Component/Cache/Tests/Adapter/CouchbaseCollectionAdapterTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,25 @@
1212
namespace Symfony\Component\Cache\Tests\Adapter;
1313

1414
use Psr\Cache\CacheItemPoolInterface;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1615
use Symfony\Component\Cache\Adapter\AbstractAdapter;
1716
use Symfony\Component\Cache\Adapter\CouchbaseCollectionAdapter;
1817

1918
/**
2019
* @requires extension couchbase <4.0.0
2120
* @requires extension couchbase >=3.0.5
2221
*
23-
* @group legacy integration
22+
* @group integration
2423
*
2524
* @author Antonio Jose Cerezo Aranda <aj.cerezo@gmail.com>
2625
*/
2726
class CouchbaseCollectionAdapterTest extends AdapterTestCase
2827
{
29-
use ExpectDeprecationTrait;
30-
3128
protected $skippedTests = [
3229
'testClearPrefix' => 'Couchbase cannot clear by prefix',
3330
];
3431

3532
public function createCachePool($defaultLifetime = 0): CacheItemPoolInterface
3633
{
37-
$this->expectDeprecation('Since symfony/cache 7.1: The "Symfony\Component\Cache\Adapter\CouchbaseBucketAdapter" class is deprecated, use "Symfony\Component\Cache\Adapter\CouchbaseCollectionAdapter" instead.');
38-
3934
$client = AbstractAdapter::createConnection('couchbase://'.getenv('COUCHBASE_HOST').'/cache',
4035
['username' => getenv('COUCHBASE_USER'), 'password' => getenv('COUCHBASE_PASS')]
4136
);

0 commit comments

Comments
 (0)
0