JqadmControllerTest::testDeleteAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
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 5
rs 10
1
<?php
2
3
class JqadmControllerTest extends \LocalWebTestCase
4
{
5
	public function testFileActionCss()
6
	{
7
		$response = $this->call( 'GET', '/unittest/admin/jqadm/file/css' );
8
9
		$this->assertEquals( 200, $response->getStatusCode() );
10
		$this->assertStringContainsString( '.aimeos', (string) $response->getBody() );
11
	}
12
13
14
	public function testFileActionJs()
15
	{
16
		$response = $this->call( 'GET', '/unittest/admin/jqadm/file/js' );
17
18
		$this->assertEquals( 200, $response->getStatusCode() );
19
		$this->assertStringContainsString( 'Aimeos = {', (string) $response->getBody() );
20
	}
21
22
23
	public function testCopyAction()
24
	{
25
		$response = $this->call( 'GET', '/unittest/admin/jqadm/copy/product/0' );
26
27
		$this->assertEquals( 200, $response->getStatusCode() );
28
		$this->assertStringContainsString( 'item-product', (string) $response->getBody() );
29
	}
30
31
32
	public function testCreateAction()
33
	{
34
		$response = $this->call( 'GET', '/unittest/admin/jqadm/create/product' );
35
36
		$this->assertEquals( 200, $response->getStatusCode() );
37
		$this->assertStringContainsString( 'item-product', (string) $response->getBody() );
38
	}
39
40
41
	public function testDeleteAction()
42
	{
43
		$response = $this->call( 'GET', '/unittest/admin/jqadm/delete/product/0' );
44
45
		$this->assertEquals( 302, $response->getStatusCode() );
46
	}
47
48
49
	public function testExportAction()
50
	{
51
		$response = $this->call( 'GET', '/unittest/admin/jqadm/export/order' );
52
53
		$this->assertEquals( 200, $response->getStatusCode() );
54
		$this->assertStringContainsString( 'list-items', (string) $response->getBody() );
55
	}
56
57
58
	public function testGetAction()
59
	{
60
		$response = $this->call( 'GET', '/unittest/admin/jqadm/get/product/0' );
61
62
		$this->assertEquals( 200, $response->getStatusCode() );
63
		$this->assertStringContainsString( 'item-product', (string) $response->getBody() );
64
	}
65
66
67
	public function testSaveAction()
68
	{
69
		$response = $this->call( 'POST', '/unittest/admin/jqadm/save/product/0' );
70
71
		$this->assertEquals( 200, $response->getStatusCode() );
72
		$this->assertStringContainsString( 'item-product', (string) $response->getBody() );
73
	}
74
75
76
	public function testSearchAction()
77
	{
78
		$response = $this->call( 'GET', '/unittest/admin/jqadm/search/product' );
79
80
		$this->assertEquals( 200, $response->getStatusCode() );
81
		$this->assertStringContainsString( 'list-items', (string) $response->getBody() );
82
	}
83
}
84