TranslationsSpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_implements_translations_interface() 0 4 1
A it_trans_when_the_WPML_is_not_installed() 0 4 1
A it_trans_returns_translation() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the WPFoundation library.
5
 *
6
 * Copyright (c) 2015-present LIN3S <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\LIN3S\WPFoundation\Configuration\Translations;
13
14
use LIN3S\WordPressPhpSpecBridge\ObjectBehavior;
15
16
/**
17
 * Spec of Translations class.
18
 *
19
 * @author Beñat Espiña <[email protected]>
20
 */
21
class TranslationsSpec extends ObjectBehavior
22
{
23
    function it_is_initializable()
24
    {
25
        $this->shouldHaveType('LIN3S\WPFoundation\Configuration\Translations\Translations');
26
    }
27
28
    function it_implements_translations_interface()
29
    {
30
        $this->shouldHaveType('LIN3S\WPFoundation\Configuration\Translations\TranslationsInterface');
31
    }
32
33
    function it_trans_when_the_WPML_is_not_installed()
34
    {
35
        $this->trans('dummy-key')->shouldReturn('dummy-key');
36
    }
37
38
    function it_trans_returns_translation()
39
    {
40
        include_once __DIR__ . '/../../../../../vendor/lin3s/wp-phpspec-brigde/src/LIN3S/WordPressPhpSpecBridge/Wpml.php';
41
42
        $this->trans('dummy-key')->shouldReturn('translation of dummy-key');
43
    }
44
}
45