1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Obblm\Core\Tests\Helper; |
4
|
|
|
|
5
|
|
|
use Obblm\Core\Helper\CoreTranslation; |
6
|
|
|
use PHPUnit\Framework\TestCase; |
|
|
|
|
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() { |
|
|
|
|
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() { |
|
|
|
|
58
|
|
|
$expected = self::RULE . '.rosters.' . self::ROSTER .'.title'; |
59
|
|
|
$result = CoreTranslation::getRosterKey(self::RULE, self::ROSTER); |
60
|
|
|
$this->assertSame($expected, $result); |
61
|
|
|
} |
62
|
|
|
} |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths