Passed
Push — master ( 8bcc71...8cfc58 )
by Aimeos
05:38
created

StandardTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2019
6
 */
7
8
9
namespace Aimeos\MW\View\Helper\Map;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp()
18
	{
19
		$this->object = new \Aimeos\MW\View\Helper\Map\Standard( new \Aimeos\MW\View\Standard() );
0 ignored issues
show
Unused Code introduced by
The call to Aimeos\MW\View\Helper\Map\Standard::__construct() has too many arguments starting with new Aimeos\MW\View\Standard(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
		$this->object = /** @scrutinizer ignore-call */ new \Aimeos\MW\View\Helper\Map\Standard( new \Aimeos\MW\View\Standard() );

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
20
	}
21
22
23
	protected function tearDown()
24
	{
25
		unset( $this->object );
26
	}
27
28
29
	public function testTransform()
30
	{
31
		$list = [['test1' => 'value1', 'test2' => 'value2']];
32
		$this->assertEquals( ['value1' => 'value2'], $this->object->transform( $list, 'test1', 'test2' )->toArray() );
33
	}
34
35
36
	public function testTransformMap()
37
	{
38
		$list = \Aimeos\MW\Map::from( [['test1' => 'value1', 'test2' => 'value2']] );
39
		$this->assertEquals( ['value1' => 'value2'], $this->object->transform( $list, 'test1', 'test2' )->toArray() );
40
	}
41
}
42