Completed
Push — master ( 1a27eb...ec4895 )
by Aimeos
08:55
created

JqadmControllerTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 7
c 2
b 1
f 1
lcom 0
cbo 0
dl 0
loc 64
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
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 testCopyAction()
9
	{
10
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/copy/product/0', 'GET' );
11
12
		$this->assertEquals( 200, $response->getStatusCode() );
13
		$this->assertContains( '<div class="product-item', $response->getContent() );
14
	}
15
16
17
	public function testCreateAction()
18
	{
19
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/create/product', 'GET' );
20
21
		$this->assertEquals( 200, $response->getStatusCode() );
22
		$this->assertContains( '<div class="product-item', $response->getContent() );
23
	}
24
25
26
	public function testDeleteAction()
27
	{
28
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/delete/product/0', 'GET' );
29
30
		$this->assertEquals( 200, $response->getStatusCode() );
31
		$this->assertContains( '<table class="list-items', $response->getContent() );
32
	}
33
34
35
	public function testGetAction()
36
	{
37
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/get/product/0', 'GET' );
38
39
		$this->assertEquals( 200, $response->getStatusCode() );
40
		$this->assertContains( '<div class="product-item', $response->getContent() );
41
	}
42
43
44
	public function testSaveAction()
45
	{
46
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/save/product/0', 'POST' );
47
48
		$this->assertEquals( 200, $response->getStatusCode() );
49
		$this->assertContains( '<div class="product-item', $response->getContent() );
50
	}
51
52
53
	public function testSearchAction()
54
	{
55
		$response = $this->browser->request( 'http://localhost/unittest/jqadm/search/product', 'GET' );
56
57
		$this->assertEquals( 200, $response->getStatusCode() );
58
		$this->assertContains( '<table class="list-items', $response->getContent() );
59
	}
60
61
62
	public function testSearchActionSite()
63
	{
64
		$response = $this->browser->request( 'http://localhost/invalid/jqadm/search/product', 'GET' );
65
66
		$this->assertEquals( 200, $response->getStatusCode() );
67
		$this->assertContains( '<table class="list-items', $response->getContent() );
68
	}
69
}
70