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

EnvTest::testVerifyStashDriver()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 6
c 1
b 0
f 1
nc 2
nop 0
dl 0
loc 12
rs 9.4285
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