Completed
Push — master ( 24633a...ec1538 )
by Aimeos
11:26
created

JqadmControllerTest   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 90
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 90
rs 10
c 3
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A testFileActionCss() 0 7 1
A testFileActionJs() 0 7 1
A testCopyAction() 0 7 1
A testCreateAction() 0 7 1
A testDeleteAction() 0 7 1
A testExportAction() 0 7 1
A testGetAction() 0 7 1
A testSaveAction() 0 7 1
A testSearchAction() 0 7 1
A testSearchActionSite() 0 6 1
1
<?php
2
3
namespace Aimeos\Shop\Tests\Functional\Controller;
4
5
6
class JqadmControllerTest extends \Neos\Flow\Tests\FunctionalTestCase
7
{
8
	public function testFileActionCss()
9
	{
10
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/file/css', 'GET' );
11
12
		$this->assertEquals( 200, $response->getStatusCode() );
13
		$this->assertContains( '.aimeos', $response->getContent() );
14
	}
15
16
17
	public function testFileActionJs()
18
	{
19
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/file/js', 'GET' );
20
21
		$this->assertEquals( 200, $response->getStatusCode() );
22
		$this->assertContains( 'Aimeos = {', $response->getContent() );
23
	}
24
25
26
	public function testCopyAction()
27
	{
28
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/copy/product/0', 'GET' );
29
30
		$this->assertEquals( 200, $response->getStatusCode() );
31
		$this->assertContains( 'item-product', $response->getContent() );
32
	}
33
34
35
	public function testCreateAction()
36
	{
37
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/create/product', 'GET' );
38
39
		$this->assertEquals( 200, $response->getStatusCode() );
40
		$this->assertContains( 'item-product', $response->getContent() );
41
	}
42
43
44
	public function testDeleteAction()
45
	{
46
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/delete/product/0', 'GET' );
47
48
		$this->assertEquals( 200, $response->getStatusCode() );
49
		$this->assertContains( 'list-items', $response->getContent() );
50
	}
51
52
53
	public function testExportAction()
54
	{
55
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/export/order', 'GET' );
56
57
		$this->assertEquals( 200, $response->getStatusCode() );
58
		$this->assertContains( 'list-items', $response->getContent() );
59
	}
60
61
62
	public function testGetAction()
63
	{
64
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/get/product/0', 'GET' );
65
66
		$this->assertEquals( 200, $response->getStatusCode() );
67
		$this->assertContains( 'item-product', $response->getContent() );
68
	}
69
70
71
	public function testSaveAction()
72
	{
73
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/save/product/0', 'POST' );
74
75
		$this->assertEquals( 200, $response->getStatusCode() );
76
		$this->assertContains( 'item-product', $response->getContent() );
77
	}
78
79
80
	public function testSearchAction()
81
	{
82
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/search/product', 'GET' );
83
84
		$this->assertEquals( 200, $response->getStatusCode() );
85
		$this->assertContains( 'list-items', $response->getContent() );
86
	}
87
88
89
	public function testSearchActionSite()
90
	{
91
		$response = $this->browser->request( 'http://localhost/invalid/jqadm/search/product', 'GET' );
92
93
		$this->assertEquals( 500, $response->getStatusCode() );
94
	}
95
}
96