LocaleContextTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
A testInheritance() 0 4 1
A testInitialState() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the Lug package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Lug\Component\Translation\Tests\Provider;
13
14
use Lug\Component\Translation\Context\LocaleContext;
15
use Lug\Component\Translation\Context\LocaleContextInterface;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class LocaleContextTest extends \PHPUnit_Framework_TestCase
21
{
22
    /**
23
     * @var LocaleContext
24
     */
25
    private $localeContext;
26
27
    /**
28
     * @var string[]
29
     */
30
    private $locales;
31
32
    /**
33
     * @var string
34
     */
35
    private $fallbackLocale;
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    protected function setUp()
41
    {
42
        $this->localeContext = new LocaleContext(
43
            $this->locales = ['fr_FR'],
44
            $this->fallbackLocale = 'en_EN'
45
        );
46
    }
47
48
    public function testInheritance()
49
    {
50
        $this->assertInstanceOf(LocaleContextInterface::class, $this->localeContext);
51
    }
52
53
    public function testInitialState()
54
    {
55
        $this->assertSame($this->locales, $this->localeContext->getLocales());
56
        $this->assertSame($this->fallbackLocale, $this->localeContext->getFallbackLocale());
57
    }
58
}
59