Completed
Push — master ( 9e2bba...f5d287 )
by Aimeos
01:55
created

JqadmControllerTest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

9 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 testGetAction() 0 7 1
A testSaveAction() 0 7 1
A testSearchAction() 0 7 1
A testSearchActionSite() 0 7 1
1
<?php
2
3
namespace Aimeos\Shop\Tests\Functional\Controller;
4
5
6
class JqadmControllerTest extends \TYPO3\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( '<div class="product-item', $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( '<div class="product-item', $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( '<table class="list-items', $response->getContent() );
50
	}
51
52
53
	public function testGetAction()
54
	{
55
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/get/product/0', 'GET' );
56
57
		$this->assertEquals( 200, $response->getStatusCode() );
58
		$this->assertContains( '<div class="product-item', $response->getContent() );
59
	}
60
61
62
	public function testSaveAction()
63
	{
64
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/save/product/0', 'POST' );
65
66
		$this->assertEquals( 200, $response->getStatusCode() );
67
		$this->assertContains( '<div class="product-item', $response->getContent() );
68
	}
69
70
71
	public function testSearchAction()
72
	{
73
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/search/product', 'GET' );
74
75
		$this->assertEquals( 200, $response->getStatusCode() );
76
		$this->assertContains( '<table class="list-items', $response->getContent() );
77
	}
78
79
80
	public function testSearchActionSite()
81
	{
82
		$response = $this->browser->request( 'http://localhost/invalid/jqadm/search/product', 'GET' );
83
84
		$this->assertEquals( 200, $response->getStatusCode() );
85
		$this->assertContains( '<table class="list-items', $response->getContent() );
86
	}
87
}
88