Passed
Push — master ( 49c0d4...ffd40d )
by Aimeos
19:25 queued 16:39
created

StandardTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A tearDown() 0 3 1
A testTransform() 0 9 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2020-2022
6
 */
7
8
9
namespace Aimeos\Base\View\Helper\Typemap;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $object;
15
16
17
	protected function setUp() : void
18
	{
19
		$view = new \Aimeos\Base\View\Standard();
20
		$this->object = new \Aimeos\Base\View\Helper\Typemap\Standard( $view );
21
	}
22
23
24
	protected function tearDown() : void
25
	{
26
		unset( $this->object );
27
	}
28
29
30
	public function testTransform()
31
	{
32
		$manager = \Aimeos\MShop::create( \TestHelper::context(), 'attribute' );
33
		$items = $manager->search( $manager->filter()->slice( 0, 1 ) );
34
35
		$result = $this->object->transform( $items );
36
37
		$this->assertCount( 1, $result );
38
		$this->assertIsArray( $result->first() );
39
	}
40
}
41