Completed
Push — master ( a8b991...dda2b8 )
by Marco
06:05 queued 02:56
created

CouchbaseCacheTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 8 2
A _getCacheDriver() 0 6 1
1
<?php
2
3
namespace Doctrine\Tests\Common\Cache;
4
5
use Couchbase;
6
use Doctrine\Common\Cache\CouchbaseCache;
7
8
/**
9
 * @requires extension couchbase
10
 */
11
class CouchbaseCacheTest extends CacheTest
12
{
13
    private $couchbase;
14
15
    protected function setUp()
16
    {
17
        try {
18
            $this->couchbase = new Couchbase('127.0.0.1', 'Administrator', 'password', 'default');
19
        } catch(Exception $ex) {
0 ignored issues
show
Bug introduced by
The class Doctrine\Tests\Common\Cache\Exception does not exist. Did you forget a USE statement, or did you not list all dependencies?

Scrutinizer analyzes your composer.json/composer.lock file if available to determine the classes, and functions that are defined by your dependencies.

It seems like the listed class was neither found in your dependencies, nor was it found in the analyzed files in your repository. If you are using some other form of dependency management, you might want to disable this analysis.

Loading history...
Coding Style introduced by
Expected 1 space after CATCH keyword; 0 found
Loading history...
20
             $this->markTestSkipped('Could not instantiate the Couchbase cache because of: ' . $ex);
21
        }
22
    }
23
24
    protected function _getCacheDriver()
25
    {
26
        $driver = new CouchbaseCache();
27
        $driver->setCouchbase($this->couchbase);
28
        return $driver;
29
    }
30
}