Passed
Push — main ( f9f23c...f7616c )
by Aimeos
05:03
created

FactoryTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 35
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateClientEmpty() 0 6 1
A testCreateClientInvalidPath() 0 6 1
A testCreateClient() 0 6 1
A testCreateClientInvalidName() 0 6 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2021
6
 */
7
8
9
namespace Aimeos\Client\JsonApi\Cms;
10
11
12
class FactoryTest 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
	public function testCreateClient()
15
	{
16
		$context = \TestHelperJapi::getContext();
17
18
		$client = \Aimeos\Client\JsonApi\Cms\Factory::create( $context, 'cms' );
19
		$this->assertInstanceOf( \Aimeos\Client\JsonApi\Iface::class, $client );
20
	}
21
22
23
	public function testCreateClientEmpty()
24
	{
25
		$context = \TestHelperJapi::getContext();
26
27
		$this->expectException( \Aimeos\Client\JsonApi\Exception::class );
28
		\Aimeos\Client\JsonApi\Cms\Factory::create( $context, '' );
29
	}
30
31
32
	public function testCreateClientInvalidPath()
33
	{
34
		$context = \TestHelperJapi::getContext();
35
36
		$this->expectException( \Aimeos\Client\JsonApi\Exception::class );
37
		\Aimeos\Client\JsonApi\Cms\Factory::create( $context, '%^' );
38
	}
39
40
41
	public function testCreateClientInvalidName()
42
	{
43
		$context = \TestHelperJapi::getContext();
44
45
		$this->expectException( \Aimeos\Client\JsonApi\Exception::class );
46
		\Aimeos\Client\JsonApi\Cms\Factory::create( $context, 'cms', '%^' );
47
	}
48
}
49