Passed
Push — master ( 84367b...2c80aa )
by Aimeos
03:28
created

FactoryTest::testCreateClientNameEmpty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2021
6
 */
7
8
namespace Aimeos\Admin\JQAdm\Settings;
9
10
11
class FactoryTest extends \PHPUnit\Framework\TestCase
12
{
13
	private $context;
14
15
16
	protected function setUp() : void
17
	{
18
		$this->context = \TestHelperJqadm::getContext();
19
		$this->context->setView( \TestHelperJqadm::getView() );
20
	}
21
22
23
	public function testCreateClient()
24
	{
25
		$client = \Aimeos\Admin\JQAdm\Settings\Factory::create( $this->context );
26
		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
27
	}
28
29
30
	public function testCreateClientName()
31
	{
32
		$client = \Aimeos\Admin\JQAdm\Settings\Factory::create( $this->context, 'Standard' );
33
		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
34
	}
35
36
37
	public function testCreateClientNameEmpty()
38
	{
39
		$this->expectException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
40
		\Aimeos\Admin\JQAdm\Settings\Factory::create( $this->context, '' );
41
	}
42
43
44
	public function testCreateClientNameInvalid()
45
	{
46
		$this->expectException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
47
		\Aimeos\Admin\JQAdm\Settings\Factory::create( $this->context, '%settings' );
48
	}
49
50
51
	public function testCreateClientNameNotFound()
52
	{
53
		$this->expectException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
54
		\Aimeos\Admin\JQAdm\Settings\Factory::create( $this->context, 'test' );
55
	}
56
57
}
58