Passed
Branch v1.x-dev (23ead1)
by Benjamin
04:07
created

TranslatorTest::getPlayer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Obblm\Core\Tests\Helper;
4
5
use Obblm\Core\Helper\CoreTranslation;
6
use PHPUnit\Framework\TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class TranslatorTest extends TestCase
9
{
10
    const RULE = 'ruleKey';
11
    const FIELD = 'fieldKey';
12
    const WEATHER = 'weatherKey';
13
    const ROSTER = 'rosterKey';
14
    const SKILL = 'skillKey';
15
    const SKILL_TYPE = 'skillTypeKey';
16
    public function testAdd()
17
    {
18
        $this->getRule();
19
        $this->getRoster();
20
        $this->getSkill();
21
    }
22
    private function getRule() {
23
        $expected = self::RULE .'.title';
24
        $result = CoreTranslation::getRuleTitle(self::RULE);
25
        $this->assertSame($expected, $result);
26
        $expected = self::RULE .'.fields.' . self::FIELD . '.title';
27
        $result = CoreTranslation::getFieldKey(self::RULE, self::FIELD);
28
        $this->assertSame($expected, $result);
29
        $expected = self::RULE .'.fields.' . self::FIELD . '.weather.' . self::WEATHER;
30
        $result = CoreTranslation::getWeatherKey(self::RULE, self::FIELD, self::WEATHER);
31
        $this->assertSame($expected, $result);
32
    }
33
    private function getRoster() {
34
        $expected = self::RULE . '.rosters.' . self::ROSTER .'.title';
35
        $result = CoreTranslation::getRosterKey(self::RULE, self::ROSTER);
36
        $this->assertSame($expected, $result);
37
        $expected = self::RULE . '.rosters.' . self::ROSTER .'.description';
38
        $result = CoreTranslation::getRosterDescription(self::RULE, self::ROSTER);
39
        $this->assertSame($expected, $result);
40
    }
41
    private function getSkill() {
42
        $expected = self::RULE . '.skills.' . self::SKILL .'.title';
43
        $result = CoreTranslation::getSkillNameKey(self::RULE, self::SKILL);
44
        $this->assertSame($expected, $result);
45
        $expected = self::RULE . '.skills.' . self::SKILL .'.description';
46
        $result = CoreTranslation::getSkillDescription(self::RULE, self::SKILL);
47
        $this->assertSame($expected, $result);
48
        $expected = self::RULE . '.skill_types.' . self::SKILL_TYPE;
49
        $result = CoreTranslation::getSkillType(self::RULE, self::SKILL_TYPE);
50
        $this->assertSame($expected, $result);
51
    }
52
    private function getTeam() {
0 ignored issues
show
Unused Code introduced by
The method getTeam() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
53
        $expected = self::RULE . '.rosters.' . self::ROSTER .'.title';
54
        $result = CoreTranslation::getRosterKey(self::RULE, self::ROSTER);
55
        $this->assertSame($expected, $result);
56
    }
57
    private function getPlayer() {
0 ignored issues
show
Unused Code introduced by
The method getPlayer() is not used, and could be removed.

This check looks for private methods that have been defined, but are not used inside the class.

Loading history...
58
        $expected = self::RULE . '.rosters.' . self::ROSTER .'.title';
59
        $result = CoreTranslation::getRosterKey(self::RULE, self::ROSTER);
60
        $this->assertSame($expected, $result);
61
    }
62
}