Completed
Push — master ( 0acc31...830070 )
by Aimeos
02:31
created

JsonApiTest::testClearSite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2017-2018
6
 */
7
8
9
namespace Aimeos\Client;
10
11
12
class JsonApiTest extends \PHPUnit\Framework\TestCase
13
{
14
	public function testCreate()
15
	{
16
		$context = \TestHelperJapi::getContext();
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 = \TestHelperJapi::getContext();
26
27
		$client = \Aimeos\Client\JsonApi::create( $context, '' );
28
		$this->assertInstanceOf( \Aimeos\Client\JsonApi\Iface::class, $client );
29
	}
30
31
32
	public function testCreateInvalidPath()
33
	{
34
		$context = \TestHelperJapi::getContext();
35
36
		$this->setExpectedException( \Aimeos\Client\JsonApi\Exception::class );
37
		\Aimeos\Client\JsonApi::create( $context, '%^' );
38
	}
39
40
41
	public function testCreateInvalidName()
42
	{
43
		$context = \TestHelperJapi::getContext();
44
45
		$this->setExpectedException( \Aimeos\Client\JsonApi\Exception::class );
46
		\Aimeos\Client\JsonApi::create( $context, '', '%^' );
47
	}
48
}