StandardTest::tearDown()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 */
7
8
9
namespace Aimeos\Controller\Jobs\Xml\Import;
10
11
12
class StandardTest extends \PHPUnit\Framework\TestCase
13
{
14
	private $context;
15
	private $object;
16
17
18
	protected function setUp() : void
19
	{
20
		\Aimeos\MShop::cache( true );
21
22
		$aimeos = \TestHelper::getAimeos();
23
		$this->context = \TestHelper::context();
24
25
		$this->object = new \Aimeos\Controller\Jobs\Xml\Import\Standard( $this->context, $aimeos );
26
	}
27
28
29
	protected function tearDown() : void
30
	{
31
		unset( $this->object, $this->context );
32
		\Aimeos\MShop::cache( false );
33
	}
34
35
36
	public function testGetName()
37
	{
38
		$this->assertEquals( 'All XML import', $this->object->getName() );
39
	}
40
41
42
	public function testGetDescription()
43
	{
44
		$text = 'Executes all XML importers and rebuild the index';
45
		$this->assertEquals( $text, $this->object->getDescription() );
46
	}
47
48
49
	public function testRun()
50
	{
51
		$config = $this->context->config();
52
		$config->set( 'controller/jobs/group/import/xml/location', __DIR__ . '/_testfiles' );
53
		$config->set( 'controller/jobs/customer/import/xml/location', __DIR__ . '/_testfiles' );
54
		$config->set( 'controller/jobs/attribute/import/xml/location', __DIR__ . '/_testfiles' );
55
		$config->set( 'controller/jobs/product/import/xml/location', __DIR__ . '/_testfiles' );
56
		$config->set( 'controller/jobs/supplier/import/xml/location', __DIR__ . '/_testfiles' );
57
		$config->set( 'controller/jobs/catalog/import/xml/location', __DIR__ . '/_testfiles' );
58
59
		$this->object->run();
60
	}
61
}
62