APCTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 9
c 1
b 0
f 0
dl 0
loc 39
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 3 1
A setUp() 0 4 1
A testDt() 0 3 1
A testDn() 0 3 1
A testAll() 0 3 1
A testGetLocale() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 */
7
8
9
namespace Aimeos\Base\Translation\Decorator;
10
11
12
class APCTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp() : void
18
	{
19
		$trans = new \Aimeos\Base\Translation\None( 'en_GB' );
20
		$this->object = new \Aimeos\Base\Translation\Decorator\APC( $trans, 'i18n' );
21
	}
22
23
24
	protected function tearDown() : void
25
	{
26
		unset( $this->object );
27
	}
28
29
30
	public function testAll()
31
	{
32
		$this->assertEquals( [], $this->object->all( 'domain' ) );
33
	}
34
35
36
	public function testDt()
37
	{
38
		$this->assertEquals( 'test', $this->object->dt( 'domain', 'test' ) );
39
	}
40
41
42
	public function testDn()
43
	{
44
		$this->assertEquals( 'tests', $this->object->dn( 'domain', 'test', 'tests', 2 ) );
45
	}
46
47
48
	public function testGetLocale()
49
	{
50
		$this->assertEquals( 'en_GB', $this->object->getLocale() );
51
	}
52
}
53