Passed
Pull Request — master (#251)
by Gabriel
10:21
created

CouchbaseCacheTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 20
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2
rs 10
1
<?php
2
3
namespace Doctrine\Tests\Common\Cache;
4
5
use Couchbase;
6
use Doctrine\Common\Cache\CacheProvider;
7
use Doctrine\Common\Cache\CouchbaseCache;
8
9
/**
10
 * @requires extension couchbase >=1.0
11
 * @requires extension couchbase <2.0
12
 */
13
class CouchbaseCacheTest extends CacheTest
14
{
15
    private $couchbase;
16
17
    protected function setUp() : void
18
    {
19
        try {
20
            $this->couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default');
21
        } catch (\Throwable $ex) {
22
             $this->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex);
23
        }
24
    }
25
26
    protected function _getCacheDriver() : CacheProvider
27
    {
28
        $driver = new CouchbaseCache();
29
        $driver->setCouchbase($this->couchbase);
30
        return $driver;
31
    }
32
}
33