Passed
Push — master ( 95b7f6...1b2e20 )
by Aimeos
17:41 queued 15:02
created

JsonApiTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 10
c 1
b 0
f 0
dl 0
loc 26
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate() 0 6 1
A testCreateEmpty() 0 6 1
A testCreateInvalidName() 0 6 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2022
6
 */
7
8
9
namespace Aimeos\Client;
10
11
12
class JsonApiTest extends \PHPUnit\Framework\TestCase
13
{
14
	public function testCreate()
15
	{
16
		$context = \TestHelper::context();
17
18
		$client = \Aimeos\Client\JsonApi::create( $context, 'product' );
19
		$this->assertInstanceOf( \Aimeos\Client\JsonApi\Iface::class, $client );
20
	}
21
22
23
	public function testCreateEmpty()
24
	{
25
		$context = \TestHelper::context();
26
27
		$client = \Aimeos\Client\JsonApi::create( $context, '' );
28
		$this->assertInstanceOf( \Aimeos\Client\JsonApi\Iface::class, $client );
29
	}
30
31
32
	public function testCreateInvalidName()
33
	{
34
		$context = \TestHelper::context();
35
36
		$this->expectException( \Aimeos\Client\JsonApi\Exception::class );
37
		\Aimeos\Client\JsonApi::create( $context, '', '%^unknown' );
38
	}
39
}
40