Completed
Push — travis_test_redis ( f52304...3ee693 )
by André
22:34
created

EnvTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 18
rs 10
wmc 2
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A testVerifyStashDriver() 0 12 2
1
<?php
2
3
/**
4
 * File containing the EnvTest class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\API\Repository\Tests\Regression;
10
11
use eZ\Publish\API\Repository\Tests\BaseTest;
12
13
/**
14
 * Test case to verify Integration tests are setup with the right instances.
15
 */
16
class EnvTest extends BaseTest
17
{
18
    /**
19
     * Verify Redis is setup if asked for.
20
     */
21
    public function testVerifyStashDriver()
22
    {
23
        /** @var \Stash\Pool $pool */
24
        $pool = $this->getSetupFactory()->getServiceContainer()->get('ezpublish.cache_pool');
0 ignored issues
show
Bug introduced by
The method getServiceContainer() cannot be called from this context as it is declared protected in class eZ\Publish\API\Repository\Tests\SetupFactory.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
25
26
        if (getenv('CUSTOM_CACHE_POOL') === 'singleredis') {
27
            $this->assertInstanceOf('\Stash\Driver\Redis', $pool->getDriver());
28
        } else {
29
            $this->assertInstanceOf('\Stash\Driver\Ephemeral', $pool->getDriver());
30
        }
31
32
    }
33
}
34