Passed
Push — master ( 03797e...f65fd3 )
by Aimeos
02:45
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 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
nc 1
nop 0
cc 1
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\Jincluded;
10
11
12
class StandardTest extends \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...
13
{
14
	private $object;
15
16
17
	protected function setUp()
18
	{
19
		$this->object = new \Aimeos\MW\View\Helper\Jincluded\Standard( new \Aimeos\MW\View\Standard() );
20
	}
21
22
23
	protected function tearDown()
24
	{
25
		unset( $this->object );
26
	}
27
28
29
	public function testTransformCatalog()
30
	{
31
		$manager = \Aimeos\MShop::create( \TestHelperCustom::getContext(), 'catalog' );
32
		$tree = $manager->getTree( $manager->findItem( 'group' )->getId(), ['media', 'text'] );
33
34
		$this->assertEquals( 13, count( $this->object->transform( $tree, [] ) ) );
35
	}
36
37
38
	public function testTransformCustomer()
39
	{
40
		$domains = ['customer/address', 'customer/property'];
41
		$item = \Aimeos\MShop::create( \TestHelperCustom::getContext(), 'customer' )->findItem( 'UTC001', $domains );
42
43
		$this->assertEquals( 2, count( $this->object->transform( $item, [] ) ) );
44
	}
45
46
47
	public function testTransformProduct()
48
	{
49
		$domains = ['attribute', 'media', 'price', 'product', 'product/property', 'text'];
50
		$item = \Aimeos\MShop::create( \TestHelperCustom::getContext(), 'product' )->findItem( 'CNE', $domains );
51
52
		$this->assertGreaterThanOrEqual( 66, count( $this->object->transform( $item, [] ) ) );
53
	}
54
}
55