Completed
Branch master (eb8dc7)
by Aimeos
03:09
created
admin/jsonadm/tests/Admin/JsonAdm/Order/StandardTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Order\Standard( $this->context, $this->view, $templatePaths, 'order' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Order\Standard($this->context, $this->view, $templatePaths, 'order');
26 26
 	}
27 27
 
28 28
 
@@ -30,27 +30,27 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'order.datepayment' => '2008-02-15 12:34:56' )
33
+				'==' => array('order.datepayment' => '2008-02-15 12:34:56')
34 34
 			),
35 35
 			'include' => 'order/base,order/status'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
44
-
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'order', $result['data'][0]['type'] );
50
-		$this->assertEquals( 3, count( $result['data'][0]['relationships']['order/status'] ) );
51
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['order/base'] ) );
52
-		$this->assertEquals( 4, count( $result['included'] ) );
53
-		$this->assertArrayNotHasKey( 'errors', $result );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44
+
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('order', $result['data'][0]['type']);
50
+		$this->assertEquals(3, count($result['data'][0]['relationships']['order/status']));
51
+		$this->assertEquals(1, count($result['data'][0]['relationships']['order/base']));
52
+		$this->assertEquals(4, count($result['included']));
53
+		$this->assertArrayNotHasKey('errors', $result);
54 54
 	}
55 55
 
56 56
 
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 			'sort' => 'order.id',
64 64
 			'include' => 'order/status'
65 65
 		);
66
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
67
-		$this->view->addHelper( 'param', $helper );
66
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
67
+		$this->view->addHelper('param', $helper);
68 68
 
69 69
 		$header = array();
70 70
 		$status = 500;
71 71
 
72
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
73
-
74
-		$this->assertEquals( 200, $status );
75
-		$this->assertEquals( 1, count( $header ) );
76
-		$this->assertGreaterThanOrEqual( 4, $result['meta']['total'] );
77
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'] ) );
78
-		$this->assertEquals( 'order', $result['data'][0]['type'] );
79
-		$this->assertEquals( 2, count( $result['data'][0]['attributes'] ) );
80
-		$this->assertGreaterThanOrEqual( 3, count( $result['data'][0]['relationships']['order/status'] ) );
81
-		$this->assertGreaterThanOrEqual( 11, count( $result['included'] ) );
82
-		$this->assertArrayNotHasKey( 'errors', $result );
72
+		$result = json_decode($this->object->get('', $header, $status), true);
73
+
74
+		$this->assertEquals(200, $status);
75
+		$this->assertEquals(1, count($header));
76
+		$this->assertGreaterThanOrEqual(4, $result['meta']['total']);
77
+		$this->assertGreaterThanOrEqual(4, count($result['data']));
78
+		$this->assertEquals('order', $result['data'][0]['type']);
79
+		$this->assertEquals(2, count($result['data'][0]['attributes']));
80
+		$this->assertGreaterThanOrEqual(3, count($result['data'][0]['relationships']['order/status']));
81
+		$this->assertGreaterThanOrEqual(11, count($result['included']));
82
+		$this->assertArrayNotHasKey('errors', $result);
83 83
 	}
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Order/Base/StandardTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Order\Base\Standard( $this->context, $this->view, $templatePaths, 'order/base' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Order\Base\Standard($this->context, $this->view, $templatePaths, 'order/base');
26 26
 	}
27 27
 
28 28
 
@@ -30,27 +30,27 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'order.base.price' => '4800.00' )
33
+				'==' => array('order.base.price' => '4800.00')
34 34
 			),
35 35
 			'include' => 'order/base/address,order/base/product'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
44
-
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'order/base', $result['data'][0]['type'] );
50
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['order/base/address'] ) );
51
-		$this->assertEquals( 6, count( $result['data'][0]['relationships']['order/base/product'] ) );
52
-		$this->assertEquals( 7, count( $result['included'] ) );
53
-		$this->assertArrayNotHasKey( 'errors', $result );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44
+
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('order/base', $result['data'][0]['type']);
50
+		$this->assertEquals(1, count($result['data'][0]['relationships']['order/base/address']));
51
+		$this->assertEquals(6, count($result['data'][0]['relationships']['order/base/product']));
52
+		$this->assertEquals(7, count($result['included']));
53
+		$this->assertArrayNotHasKey('errors', $result);
54 54
 	}
55 55
 
56 56
 
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 			'sort' => 'order.base.id',
64 64
 			'include' => 'order/base/product'
65 65
 		);
66
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
67
-		$this->view->addHelper( 'param', $helper );
66
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
67
+		$this->view->addHelper('param', $helper);
68 68
 
69 69
 		$header = array();
70 70
 		$status = 500;
71 71
 
72
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
73
-
74
-		$this->assertEquals( 200, $status );
75
-		$this->assertEquals( 1, count( $header ) );
76
-		$this->assertGreaterThanOrEqual( 4, $result['meta']['total'] );
77
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'] ) );
78
-		$this->assertEquals( 'order/base', $result['data'][0]['type'] );
79
-		$this->assertEquals( 2, count( $result['data'][0]['attributes'] ) );
80
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'][0]['relationships']['order/base/product'] ) );
81
-		$this->assertGreaterThanOrEqual( 14, count( $result['included'] ) );
82
-		$this->assertArrayNotHasKey( 'errors', $result );
72
+		$result = json_decode($this->object->get('', $header, $status), true);
73
+
74
+		$this->assertEquals(200, $status);
75
+		$this->assertEquals(1, count($header));
76
+		$this->assertGreaterThanOrEqual(4, $result['meta']['total']);
77
+		$this->assertGreaterThanOrEqual(4, count($result['data']));
78
+		$this->assertEquals('order/base', $result['data'][0]['type']);
79
+		$this->assertEquals(2, count($result['data'][0]['attributes']));
80
+		$this->assertGreaterThanOrEqual(4, count($result['data'][0]['relationships']['order/base/product']));
81
+		$this->assertGreaterThanOrEqual(14, count($result['included']));
82
+		$this->assertArrayNotHasKey('errors', $result);
83 83
 	}
84 84
 }
85 85
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Text/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Text\Standard( $this->context, $this->view, $templatePaths, 'text' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Text\Standard($this->context, $this->view, $templatePaths, 'text');
26 26
 	}
27 27
 
28 28
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'text.label' => 'misc_long_desc' )
33
+				'==' => array('text.label' => 'misc_long_desc')
34 34
 			),
35 35
 			'include' => 'media'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44 44
 
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'text', $result['data'][0]['type'] );
50
-		$this->assertEquals( 4, count( $result['data'][0]['relationships']['media'] ) );
51
-		$this->assertEquals( 4, count( $result['included'] ) );
52
-		$this->assertArrayNotHasKey( 'errors', $result );
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('text', $result['data'][0]['type']);
50
+		$this->assertEquals(4, count($result['data'][0]['relationships']['media']));
51
+		$this->assertEquals(4, count($result['included']));
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Price/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Media\Standard( $this->context, $this->view, $templatePaths, 'price' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Media\Standard($this->context, $this->view, $templatePaths, 'price');
26 26
 	}
27 27
 
28 28
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'price.value' => '12.95' )
33
+				'==' => array('price.value' => '12.95')
34 34
 			),
35 35
 			'include' => 'attribute'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44 44
 
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 2, $result['meta']['total'] );
48
-		$this->assertEquals( 2, count( $result['data'] ) );
49
-		$this->assertEquals( 'price', $result['data'][0]['type'] );
50
-		$this->assertEquals( 0, count( $result['data'][0]['relationships'] ) );
51
-		$this->assertEquals( 0, count( $result['included'] ) );
52
-		$this->assertArrayNotHasKey( 'errors', $result );
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(2, $result['meta']['total']);
48
+		$this->assertEquals(2, count($result['data']));
49
+		$this->assertEquals('price', $result['data'][0]['type']);
50
+		$this->assertEquals(0, count($result['data'][0]['relationships']));
51
+		$this->assertEquals(0, count($result['included']));
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Attribute/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard( $this->context, $this->view, $templatePaths, 'attribute' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard($this->context, $this->view, $templatePaths, 'attribute');
26 26
 	}
27 27
 
28 28
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'attribute.code' => 's' )
33
+				'==' => array('attribute.code' => 's')
34 34
 			),
35 35
 			'include' => 'text'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44 44
 
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'attribute', $result['data'][0]['type'] );
50
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['text'] ) );
51
-		$this->assertEquals( 1, count( $result['included'] ) );
52
-		$this->assertArrayNotHasKey( 'errors', $result );
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('attribute', $result['data'][0]['type']);
50
+		$this->assertEquals(1, count($result['data'][0]['relationships']['text']));
51
+		$this->assertEquals(1, count($result['included']));
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Service/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Service\Standard( $this->context, $this->view, $templatePaths, 'service' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Service\Standard($this->context, $this->view, $templatePaths, 'service');
26 26
 	}
27 27
 
28 28
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'service.code' => 'unitpaymentcode' )
33
+				'==' => array('service.code' => 'unitpaymentcode')
34 34
 			),
35 35
 			'include' => 'text'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44 44
 
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'service', $result['data'][0]['type'] );
50
-		$this->assertEquals( 3, count( $result['data'][0]['relationships']['text'] ) );
51
-		$this->assertEquals( 3, count( $result['included'] ) );
52
-		$this->assertArrayNotHasKey( 'errors', $result );
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('service', $result['data'][0]['type']);
50
+		$this->assertEquals(3, count($result['data'][0]['relationships']['text']));
51
+		$this->assertEquals(3, count($result['included']));
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Media/StandardTest.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$templatePaths = \TestHelperJadm::getJsonadmPaths();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Media\Standard( $this->context, $this->view, $templatePaths, 'media' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Media\Standard($this->context, $this->view, $templatePaths, 'media');
26 26
 	}
27 27
 
28 28
 
@@ -30,25 +30,25 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'media.label' => 'cn_colombie_179x178' )
33
+				'==' => array('media.label' => 'cn_colombie_179x178')
34 34
 			),
35 35
 			'include' => 'attribute'
36 36
 		);
37
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
38
-		$this->view->addHelper( 'param', $helper );
37
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
38
+		$this->view->addHelper('param', $helper);
39 39
 
40 40
 		$header = array();
41 41
 		$status = 500;
42 42
 
43
-		$result = json_decode( $this->object->get( '', $header, $status ), true );
43
+		$result = json_decode($this->object->get('', $header, $status), true);
44 44
 
45
-		$this->assertEquals( 200, $status );
46
-		$this->assertEquals( 1, count( $header ) );
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'media', $result['data'][0]['type'] );
50
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['attribute'] ) );
51
-		$this->assertEquals( 1, count( $result['included'] ) );
52
-		$this->assertArrayNotHasKey( 'errors', $result );
45
+		$this->assertEquals(200, $status);
46
+		$this->assertEquals(1, count($header));
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('media', $result['data'][0]['type']);
50
+		$this->assertEquals(1, count($result['data'][0]['relationships']['attribute']));
51
+		$this->assertEquals(1, count($result['included']));
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 }
55 55
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/TestHelperJadm.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 	public static function bootstrap()
16 16
 	{
17 17
 		self::getAimeos();
18
-		\Aimeos\MShop\Factory::setCache( false );
19
-		\Aimeos\Admin\JsonAdm\Factory::setCache( false );
18
+		\Aimeos\MShop\Factory::setCache(false);
19
+		\Aimeos\Admin\JsonAdm\Factory::setCache(false);
20 20
 	}
21 21
 
22 22
 
23
-	public static function getContext( $site = 'unittest' )
23
+	public static function getContext($site = 'unittest')
24 24
 	{
25
-		if( !isset( self::$context[$site] ) ) {
26
-			self::$context[$site] = self::createContext( $site );
25
+		if (!isset(self::$context[$site])) {
26
+			self::$context[$site] = self::createContext($site);
27 27
 		}
28 28
 
29 29
 		return clone self::$context[$site];
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public static function getAimeos()
34 34
 	{
35
-		if( !isset( self::$aimeos ) )
35
+		if (!isset(self::$aimeos))
36 36
 		{
37 37
 			require_once 'Bootstrap.php';
38
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
38
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
39 39
 
40
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
41
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
40
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
41
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
42 42
 		}
43 43
 
44 44
 		return self::$aimeos;
@@ -47,79 +47,79 @@  discard block
 block discarded – undo
47 47
 
48 48
 	public static function getJsonadmPaths()
49 49
 	{
50
-		return self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' );
50
+		return self::getAimeos()->getCustomPaths('admin/jsonadm/templates');
51 51
 	}
52 52
 
53 53
 
54
-	private static function createContext( $site )
54
+	private static function createContext($site)
55 55
 	{
56 56
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
57 57
 		$aimeos = self::getAimeos();
58 58
 
59 59
 
60
-		$paths = $aimeos->getConfigPaths( 'mysql' );
60
+		$paths = $aimeos->getConfigPaths('mysql');
61 61
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
62 62
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
63 63
 
64
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
65
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
66
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
67
-		$ctx->setConfig( $conf );
64
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), $paths);
65
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
66
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
67
+		$ctx->setConfig($conf);
68 68
 
69 69
 
70
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
71
-		$ctx->setDatabaseManager( $dbm );
70
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
71
+		$ctx->setDatabaseManager($dbm);
72 72
 
73 73
 
74
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
75
-		$ctx->setLogger( $logger );
74
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
75
+		$ctx->setLogger($logger);
76 76
 
77 77
 
78 78
 		$session = new \Aimeos\MW\Session\None();
79
-		$ctx->setSession( $session );
79
+		$ctx->setSession($session);
80 80
 
81 81
 
82
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
83
-		$ctx->setI18n( array( 'de' => $i18n ) );
82
+		$i18n = new \Aimeos\MW\Translation\None('de');
83
+		$ctx->setI18n(array('de' => $i18n));
84 84
 
85 85
 
86
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
87
-		$locale = $localeManager->bootstrap( $site, 'de', '', false );
88
-		$ctx->setLocale( $locale );
86
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
87
+		$locale = $localeManager->bootstrap($site, 'de', '', false);
88
+		$ctx->setLocale($locale);
89 89
 
90 90
 
91
-		$view = self::createView( $conf );
92
-		$ctx->setView( $view );
91
+		$view = self::createView($conf);
92
+		$ctx->setView($view);
93 93
 
94 94
 
95
-		$ctx->setEditor( 'core:admin/jsonadm' );
95
+		$ctx->setEditor('core:admin/jsonadm');
96 96
 
97 97
 		return $ctx;
98 98
 	}
99 99
 
100 100
 
101
-	protected static function createView( \Aimeos\MW\Config\Iface $config )
101
+	protected static function createView(\Aimeos\MW\Config\Iface $config)
102 102
 	{
103
-		$tmplpaths = self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' );
103
+		$tmplpaths = self::getAimeos()->getCustomPaths('admin/jsonadm/templates');
104 104
 
105
-		$view = new \Aimeos\MW\View\Standard( $tmplpaths );
105
+		$view = new \Aimeos\MW\View\Standard($tmplpaths);
106 106
 
107
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
108
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
109
-		$view->addHelper( 'translate', $helper );
107
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
108
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
109
+		$view->addHelper('translate', $helper);
110 110
 
111
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
112
-		$view->addHelper( 'url', $helper );
111
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
112
+		$view->addHelper('url', $helper);
113 113
 
114
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
115
-		$view->addHelper( 'number', $helper );
114
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
115
+		$view->addHelper('number', $helper);
116 116
 
117
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
118
-		$view->addHelper( 'date', $helper );
117
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
118
+		$view->addHelper('date', $helper);
119 119
 
120
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin/jsonadm' ) );
121
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
122
-		$view->addHelper( 'config', $helper );
120
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin/jsonadm'));
121
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
122
+		$view->addHelper('config', $helper);
123 123
 
124 124
 		return $view;
125 125
 	}
Please login to merge, or discard this patch.
admin/jsonadm/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 
9 9
 error_reporting( -1 );
10
-ini_set( 'display_errors', '1' );
10
+ini_set('display_errors', '1');
11 11
 
12
-date_default_timezone_set( 'UTC' );
12
+date_default_timezone_set('UTC');
13 13
 
14 14
 // Set locale settings to reasonable defaults
15
-setlocale( LC_ALL, 'en_US.UTF-8' );
16
-setlocale( LC_NUMERIC, 'POSIX' );
17
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
18
-setlocale( LC_TIME, 'POSIX' );
15
+setlocale(LC_ALL, 'en_US.UTF-8');
16
+setlocale(LC_NUMERIC, 'POSIX');
17
+setlocale(LC_CTYPE, 'en_US.UTF-8');
18
+setlocale(LC_TIME, 'POSIX');
19 19
 
20 20
 require_once 'TestHelperJadm.php';
21 21
 \TestHelperJadm::bootstrap();
Please login to merge, or discard this patch.