Completed
Push — master ( 4533c7...c7f940 )
by Aimeos
02:24
created
admin/jsonadm/src/Admin/JsonAdm/Product/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
 	 * @param array $include List of resource types that should be fetched
108 108
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
109 109
 	 */
110
-	protected function getChildItems( array $items, array $include )
110
+	protected function getChildItems(array $items, array $include)
111 111
 	{
112 112
 		$list = array();
113
-		$prodIds = array_keys( $items );
114
-		$include = array_intersect( $include, array( 'product/property' ) );
113
+		$prodIds = array_keys($items);
114
+		$include = array_intersect($include, array('product/property'));
115 115
 
116
-		foreach( $include as $type )
116
+		foreach ($include as $type)
117 117
 		{
118
-			$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type );
118
+			$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type);
119 119
 
120 120
 			$search = $manager->createSearch();
121
-			$search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $prodIds ) );
121
+			$search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $prodIds));
122 122
 
123
-			$list = array_merge( $list, $manager->searchItems( $search ) );
123
+			$list = array_merge($list, $manager->searchItems($search));
124 124
 		}
125 125
 
126 126
 		return $list;
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 	 * @param array $include List of resource types that should be fetched
135 135
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface
136 136
 	 */
137
-	protected function getListItems( array $items, array $include )
137
+	protected function getListItems(array $items, array $include)
138 138
 	{
139
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' );
139
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists');
140 140
 
141 141
 		$search = $manager->createSearch();
142 142
 		$expr = array(
143
-			$search->compare( '==', 'product.lists.parentid', array_keys( $items ) ),
144
-			$search->compare( '==', 'product.lists.domain', $include ),
143
+			$search->compare('==', 'product.lists.parentid', array_keys($items)),
144
+			$search->compare('==', 'product.lists.domain', $include),
145 145
 		);
146
-		$search->setConditions( $search->combine( '&&', $expr ) );
146
+		$search->setConditions($search->combine('&&', $expr));
147 147
 
148
-		return $manager->searchItems( $search );
148
+		return $manager->searchItems($search);
149 149
 	}
150 150
 }
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Catalog/StandardTest.php 1 patch
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJadm::getContext();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Catalog\Standard( $this->context, $this->view, $templatePaths, 'catalog' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Catalog\Standard($this->context, $this->view, $templatePaths, 'catalog');
26 26
 	}
27 27
 
28 28
 
@@ -30,145 +30,145 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'catalog.code' => 'cafe' )
33
+				'==' => array('catalog.code' => 'cafe')
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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'catalog', $result['data'][0]['type'] );
50
-		$this->assertEquals( 6, count( $result['data'][0]['relationships']['text'] ) );
51
-		$this->assertEquals( 6, count( $result['included'] ) );
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('catalog', $result['data'][0]['type']);
50
+		$this->assertEquals(6, count($result['data'][0]['relationships']['text']));
51
+		$this->assertEquals(6, count($result['included']));
52 52
 
53
-		$this->assertArrayNotHasKey( 'errors', $result );
53
+		$this->assertArrayNotHasKey('errors', $result);
54 54
 	}
55 55
 
56 56
 
57 57
 	public function testGetTree()
58 58
 	{
59 59
 		$params = array(
60
-			'id' => $this->getCatalogItem( 'group' )->getId(),
60
+			'id' => $this->getCatalogItem('group')->getId(),
61 61
 			'filter' => array(
62
-				'==' => array( 'catalog.status' => 1 )
62
+				'==' => array('catalog.status' => 1)
63 63
 			),
64 64
 			'include' => 'catalog,text'
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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
70
-		$result = json_decode( (string) $response->getBody(), true );
69
+		$response = $this->object->get($this->view->request(), $this->view->response());
70
+		$result = json_decode((string) $response->getBody(), true);
71 71
 
72 72
 
73
-		$this->assertEquals( 200, $response->getStatusCode() );
74
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
73
+		$this->assertEquals(200, $response->getStatusCode());
74
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
75 75
 
76
-		$this->assertEquals( 1, $result['meta']['total'] );
77
-		$this->assertEquals( 'catalog', $result['data']['type'] );
78
-		$this->assertEquals( 2, count( $result['data']['relationships']['catalog'] ) );
79
-		$this->assertEquals( 2, count( $result['included'] ) );
76
+		$this->assertEquals(1, $result['meta']['total']);
77
+		$this->assertEquals('catalog', $result['data']['type']);
78
+		$this->assertEquals(2, count($result['data']['relationships']['catalog']));
79
+		$this->assertEquals(2, count($result['included']));
80 80
 
81
-		$this->assertArrayNotHasKey( 'errors', $result );
81
+		$this->assertArrayNotHasKey('errors', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testPatch()
86 86
 	{
87
-		$stub = $this->getCatalogMock( array( 'getItem', 'moveItem', 'saveItem' ) );
87
+		$stub = $this->getCatalogMock(array('getItem', 'moveItem', 'saveItem'));
88 88
 
89
-		$stub->expects( $this->once() )->method( 'moveItem' );
90
-		$stub->expects( $this->once() )->method( 'saveItem' );
91
-		$stub->expects( $this->exactly( 2 ) )->method( 'getItem' ) // 2x due to decorator
92
-			->will( $this->returnValue( $stub->createItem() ) );
89
+		$stub->expects($this->once())->method('moveItem');
90
+		$stub->expects($this->once())->method('saveItem');
91
+		$stub->expects($this->exactly(2))->method('getItem') // 2x due to decorator
92
+			->will($this->returnValue($stub->createItem()));
93 93
 
94 94
 
95
-		$params = array( 'id' => '-1' );
96
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
97
-		$this->view->addHelper( 'param', $helper );
95
+		$params = array('id' => '-1');
96
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
97
+		$this->view->addHelper('param', $helper);
98 98
 
99 99
 		$body = '{"data": {"parentid": "1", "targetid": 2, "type": "catalog", "attributes": {"catalog.label": "test"}}}';
100
-		$request = $this->view->request()->withBody( $this->view->response()->createStreamFromString( $body ) );
100
+		$request = $this->view->request()->withBody($this->view->response()->createStreamFromString($body));
101 101
 
102
-		$response = $this->object->patch( $request, $this->view->response() );
103
-		$result = json_decode( (string) $response->getBody(), true );
102
+		$response = $this->object->patch($request, $this->view->response());
103
+		$result = json_decode((string) $response->getBody(), true);
104 104
 
105 105
 
106
-		$this->assertEquals( 200, $response->getStatusCode() );
107
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
106
+		$this->assertEquals(200, $response->getStatusCode());
107
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
108 108
 
109
-		$this->assertEquals( 1, $result['meta']['total'] );
110
-		$this->assertArrayHasKey( 'data', $result );
111
-		$this->assertEquals( 'catalog', $result['data']['type'] );
109
+		$this->assertEquals(1, $result['meta']['total']);
110
+		$this->assertArrayHasKey('data', $result);
111
+		$this->assertEquals('catalog', $result['data']['type']);
112 112
 
113
-		$this->assertArrayNotHasKey( 'included', $result );
114
-		$this->assertArrayNotHasKey( 'errors', $result );
113
+		$this->assertArrayNotHasKey('included', $result);
114
+		$this->assertArrayNotHasKey('errors', $result);
115 115
 	}
116 116
 
117 117
 
118 118
 	public function testPost()
119 119
 	{
120
-		$stub = $this->getCatalogMock( array( 'getItem', 'insertItem' ) );
120
+		$stub = $this->getCatalogMock(array('getItem', 'insertItem'));
121 121
 
122
-		$stub->expects( $this->any() )->method( 'getItem' )
123
-			->will( $this->returnValue( $stub->createItem() ) );
124
-		$stub->expects( $this->once() )->method( 'insertItem' );
122
+		$stub->expects($this->any())->method('getItem')
123
+			->will($this->returnValue($stub->createItem()));
124
+		$stub->expects($this->once())->method('insertItem');
125 125
 
126 126
 
127 127
 		$body = '{"data": {"type": "catalog", "attributes": {"catalog.code": "test", "catalog.label": "Test catalog"}}}';
128
-		$request = $this->view->request()->withBody( $this->view->response()->createStreamFromString( $body ) );
128
+		$request = $this->view->request()->withBody($this->view->response()->createStreamFromString($body));
129 129
 
130
-		$response = $this->object->post( $request, $this->view->response() );
131
-		$result = json_decode( (string) $response->getBody(), true );
130
+		$response = $this->object->post($request, $this->view->response());
131
+		$result = json_decode((string) $response->getBody(), true);
132 132
 
133 133
 
134
-		$this->assertEquals( 201, $response->getStatusCode() );
135
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
134
+		$this->assertEquals(201, $response->getStatusCode());
135
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
136 136
 
137
-		$this->assertEquals( 1, $result['meta']['total'] );
138
-		$this->assertArrayHasKey( 'data', $result );
139
-		$this->assertEquals( 'catalog', $result['data']['type'] );
137
+		$this->assertEquals(1, $result['meta']['total']);
138
+		$this->assertArrayHasKey('data', $result);
139
+		$this->assertEquals('catalog', $result['data']['type']);
140 140
 
141
-		$this->assertArrayNotHasKey( 'included', $result );
142
-		$this->assertArrayNotHasKey( 'errors', $result );
141
+		$this->assertArrayNotHasKey('included', $result);
142
+		$this->assertArrayNotHasKey('errors', $result);
143 143
 	}
144 144
 
145 145
 
146
-	protected function getCatalogItem( $code )
146
+	protected function getCatalogItem($code)
147 147
 	{
148
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
148
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context);
149 149
 		$search = $manager->createSearch();
150
-		$search->setConditions( $search->compare( '==', 'catalog.code', $code ) );
151
-		$items = $manager->searchItems( $search );
150
+		$search->setConditions($search->compare('==', 'catalog.code', $code));
151
+		$items = $manager->searchItems($search);
152 152
 
153
-		if( ( $item = reset( $items ) ) === false ) {
154
-			throw new \RuntimeException( sprintf( 'No catalog item with code "%1$s" found', $code ) );
153
+		if (($item = reset($items)) === false) {
154
+			throw new \RuntimeException(sprintf('No catalog item with code "%1$s" found', $code));
155 155
 		}
156 156
 
157 157
 		return $item;
158 158
 	}
159 159
 
160 160
 
161
-	protected function getCatalogMock( array $methods )
161
+	protected function getCatalogMock(array $methods)
162 162
 	{
163 163
 		$name = 'ClientJsonAdmStandard';
164
-		$this->context->getConfig()->set( 'mshop/catalog/manager/name', $name );
164
+		$this->context->getConfig()->set('mshop/catalog/manager/name', $name);
165 165
 
166
-		$stub = $this->getMockBuilder( '\\Aimeos\\MShop\\Catalog\\Manager\\Standard' )
167
-			->setConstructorArgs( array( $this->context ) )
168
-			->setMethods( $methods )
166
+		$stub = $this->getMockBuilder('\\Aimeos\\MShop\\Catalog\\Manager\\Standard')
167
+			->setConstructorArgs(array($this->context))
168
+			->setMethods($methods)
169 169
 			->getMock();
170 170
 
171
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Catalog\\Manager\\' . $name, $stub );
171
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Catalog\\Manager\\' . $name, $stub);
172 172
 
173 173
 		return $stub;
174 174
 	}
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Supplier/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\Supplier\Standard( $this->context, $this->view, $templatePaths, 'supplier' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Supplier\Standard($this->context, $this->view, $templatePaths, 'supplier');
26 26
 	}
27 27
 
28 28
 
@@ -30,28 +30,28 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'supplier.code' => 'unitCode001' )
33
+				'==' => array('supplier.code' => 'unitCode001')
34 34
 			),
35 35
 			'include' => 'text,supplier/address'
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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'supplier', $result['data'][0]['type'] );
50
-		$this->assertEquals( 3, count( $result['data'][0]['relationships']['text'] ) );
51
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['supplier/address'] ) );
52
-		$this->assertEquals( 4, count( $result['included'] ) );
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('supplier', $result['data'][0]['type']);
50
+		$this->assertEquals(3, count($result['data'][0]['relationships']['text']));
51
+		$this->assertEquals(1, count($result['data'][0]['relationships']['supplier/address']));
52
+		$this->assertEquals(4, count($result['included']));
53 53
 
54
-		$this->assertArrayNotHasKey( 'errors', $result );
54
+		$this->assertArrayNotHasKey('errors', $result);
55 55
 	}
56 56
 
57 57
 
@@ -64,23 +64,23 @@  discard block
 block discarded – undo
64 64
 			'sort' => 'supplier.id',
65 65
 			'include' => 'supplier/address'
66 66
 		);
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
71
-		$result = json_decode( (string) $response->getBody(), true );
70
+		$response = $this->object->get($this->view->request(), $this->view->response());
71
+		$result = json_decode((string) $response->getBody(), true);
72 72
 
73 73
 
74
-		$this->assertEquals( 200, $response->getStatusCode() );
75
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
74
+		$this->assertEquals(200, $response->getStatusCode());
75
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
76 76
 
77
-		$this->assertEquals( 3, $result['meta']['total'] );
78
-		$this->assertEquals( 3, count( $result['data'] ) );
79
-		$this->assertEquals( 'supplier', $result['data'][0]['type'] );
80
-		$this->assertEquals( 2, count( $result['data'][0]['attributes'] ) );
81
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['supplier/address'] ) );
82
-		$this->assertEquals( 3, count( $result['included'] ) );
77
+		$this->assertEquals(3, $result['meta']['total']);
78
+		$this->assertEquals(3, count($result['data']));
79
+		$this->assertEquals('supplier', $result['data'][0]['type']);
80
+		$this->assertEquals(2, count($result['data'][0]['attributes']));
81
+		$this->assertEquals(1, count($result['data'][0]['relationships']['supplier/address']));
82
+		$this->assertEquals(3, count($result['included']));
83 83
 
84
-		$this->assertArrayNotHasKey( 'errors', $result );
84
+		$this->assertArrayNotHasKey('errors', $result);
85 85
 	}
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Order/StandardTest.php 1 patch
Spacing   +40 added lines, -40 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,26 +30,26 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'order.editor' => 'core:unittest' )
33
+				'==' => array('order.editor' => 'core:unittest')
34 34
 			),
35 35
 			'aggregate' => 'order.cdate',
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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
47
-		$this->assertEquals( 1, $result['meta']['total'] );
48
-		$this->assertEquals( 1, count( $result['data'] ) );
49
-		$this->assertEquals( 'aggregate', $result['data'][0]['type'] );
50
-		$this->assertGreaterThan( 0, count( $result['data'][0]['attributes'] ) );
47
+		$this->assertEquals(1, $result['meta']['total']);
48
+		$this->assertEquals(1, count($result['data']));
49
+		$this->assertEquals('aggregate', $result['data'][0]['type']);
50
+		$this->assertGreaterThan(0, count($result['data'][0]['attributes']));
51 51
 
52
-		$this->assertArrayNotHasKey( 'errors', $result );
52
+		$this->assertArrayNotHasKey('errors', $result);
53 53
 	}
54 54
 
55 55
 
@@ -57,28 +57,28 @@  discard block
 block discarded – undo
57 57
 	{
58 58
 		$params = array(
59 59
 			'filter' => array(
60
-				'==' => array( 'order.datepayment' => '2008-02-15 12:34:56' )
60
+				'==' => array('order.datepayment' => '2008-02-15 12:34:56')
61 61
 			),
62 62
 			'include' => 'order/base,order/status'
63 63
 		);
64
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
65
-		$this->view->addHelper( 'param', $helper );
64
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
65
+		$this->view->addHelper('param', $helper);
66 66
 
67
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
68
-		$result = json_decode( (string) $response->getBody(), true );
67
+		$response = $this->object->get($this->view->request(), $this->view->response());
68
+		$result = json_decode((string) $response->getBody(), true);
69 69
 
70 70
 
71
-		$this->assertEquals( 200, $response->getStatusCode() );
72
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
71
+		$this->assertEquals(200, $response->getStatusCode());
72
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
73 73
 
74
-		$this->assertEquals( 1, $result['meta']['total'] );
75
-		$this->assertEquals( 1, count( $result['data'] ) );
76
-		$this->assertEquals( 'order', $result['data'][0]['type'] );
77
-		$this->assertEquals( 3, count( $result['data'][0]['relationships']['order/status'] ) );
78
-		$this->assertEquals( 1, count( $result['data'][0]['relationships']['order/base'] ) );
79
-		$this->assertEquals( 4, count( $result['included'] ) );
74
+		$this->assertEquals(1, $result['meta']['total']);
75
+		$this->assertEquals(1, count($result['data']));
76
+		$this->assertEquals('order', $result['data'][0]['type']);
77
+		$this->assertEquals(3, count($result['data'][0]['relationships']['order/status']));
78
+		$this->assertEquals(1, count($result['data'][0]['relationships']['order/base']));
79
+		$this->assertEquals(4, count($result['included']));
80 80
 
81
-		$this->assertArrayNotHasKey( 'errors', $result );
81
+		$this->assertArrayNotHasKey('errors', $result);
82 82
 	}
83 83
 
84 84
 
@@ -91,23 +91,23 @@  discard block
 block discarded – undo
91 91
 			'sort' => 'order.id',
92 92
 			'include' => 'order/status'
93 93
 		);
94
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
95
-		$this->view->addHelper( 'param', $helper );
94
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
95
+		$this->view->addHelper('param', $helper);
96 96
 
97
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
98
-		$result = json_decode( (string) $response->getBody(), true );
97
+		$response = $this->object->get($this->view->request(), $this->view->response());
98
+		$result = json_decode((string) $response->getBody(), true);
99 99
 
100 100
 
101
-		$this->assertEquals( 200, $response->getStatusCode() );
102
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
101
+		$this->assertEquals(200, $response->getStatusCode());
102
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
103 103
 
104
-		$this->assertGreaterThanOrEqual( 4, $result['meta']['total'] );
105
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'] ) );
106
-		$this->assertEquals( 'order', $result['data'][0]['type'] );
107
-		$this->assertEquals( 2, count( $result['data'][0]['attributes'] ) );
108
-		$this->assertGreaterThanOrEqual( 3, count( $result['data'][0]['relationships']['order/status'] ) );
109
-		$this->assertGreaterThanOrEqual( 11, count( $result['included'] ) );
104
+		$this->assertGreaterThanOrEqual(4, $result['meta']['total']);
105
+		$this->assertGreaterThanOrEqual(4, count($result['data']));
106
+		$this->assertEquals('order', $result['data'][0]['type']);
107
+		$this->assertEquals(2, count($result['data'][0]['attributes']));
108
+		$this->assertGreaterThanOrEqual(3, count($result['data'][0]['relationships']['order/status']));
109
+		$this->assertGreaterThanOrEqual(11, count($result['included']));
110 110
 
111
-		$this->assertArrayNotHasKey( 'errors', $result );
111
+		$this->assertArrayNotHasKey('errors', $result);
112 112
 	}
113 113
 }
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,28 +30,28 @@  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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
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'] ) );
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 53
 
54
-		$this->assertArrayNotHasKey( 'errors', $result );
54
+		$this->assertArrayNotHasKey('errors', $result);
55 55
 	}
56 56
 
57 57
 
@@ -64,23 +64,23 @@  discard block
 block discarded – undo
64 64
 			'sort' => 'order.base.id',
65 65
 			'include' => 'order/base/product'
66 66
 		);
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
71
-		$result = json_decode( (string) $response->getBody(), true );
70
+		$response = $this->object->get($this->view->request(), $this->view->response());
71
+		$result = json_decode((string) $response->getBody(), true);
72 72
 
73 73
 
74
-		$this->assertEquals( 200, $response->getStatusCode() );
75
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
74
+		$this->assertEquals(200, $response->getStatusCode());
75
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
76 76
 
77
-		$this->assertGreaterThanOrEqual( 4, $result['meta']['total'] );
78
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'] ) );
79
-		$this->assertEquals( 'order/base', $result['data'][0]['type'] );
80
-		$this->assertEquals( 2, count( $result['data'][0]['attributes'] ) );
81
-		$this->assertGreaterThanOrEqual( 4, count( $result['data'][0]['relationships']['order/base/product'] ) );
82
-		$this->assertGreaterThanOrEqual( 14, count( $result['included'] ) );
77
+		$this->assertGreaterThanOrEqual(4, $result['meta']['total']);
78
+		$this->assertGreaterThanOrEqual(4, count($result['data']));
79
+		$this->assertEquals('order/base', $result['data'][0]['type']);
80
+		$this->assertEquals(2, count($result['data'][0]['attributes']));
81
+		$this->assertGreaterThanOrEqual(4, count($result['data'][0]['relationships']['order/base/product']));
82
+		$this->assertGreaterThanOrEqual(14, count($result['included']));
83 83
 
84
-		$this->assertArrayNotHasKey( 'errors', $result );
84
+		$this->assertArrayNotHasKey('errors', $result);
85 85
 	}
86 86
 }
87 87
\ 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   +14 added lines, -14 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,26 +30,26 @@  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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
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'] ) );
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 52
 
53
-		$this->assertArrayNotHasKey( 'errors', $result );
53
+		$this->assertArrayNotHasKey('errors', $result);
54 54
 	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Locale/Site/StandardTest.php 1 patch
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJadm::getContext();
23 23
 		$this->view = $this->context->getView();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JsonAdm\Locale\Site\Standard( $this->context, $this->view, $templatePaths, 'locale/site' );
25
+		$this->object = new \Aimeos\Admin\JsonAdm\Locale\Site\Standard($this->context, $this->view, $templatePaths, 'locale/site');
26 26
 	}
27 27
 
28 28
 
@@ -30,152 +30,152 @@  discard block
 block discarded – undo
30 30
 	{
31 31
 		$params = array(
32 32
 			'filter' => array(
33
-				'==' => array( 'locale.site.code' => 'unittest' )
33
+				'==' => array('locale.site.code' => 'unittest')
34 34
 			),
35 35
 		);
36
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
37
-		$this->view->addHelper( 'param', $helper );
36
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
37
+		$this->view->addHelper('param', $helper);
38 38
 
39
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
40
-		$result = json_decode( (string) $response->getBody(), true );
39
+		$response = $this->object->get($this->view->request(), $this->view->response());
40
+		$result = json_decode((string) $response->getBody(), true);
41 41
 
42 42
 
43
-		$this->assertEquals( 200, $response->getStatusCode() );
44
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
43
+		$this->assertEquals(200, $response->getStatusCode());
44
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
45 45
 
46
-		$this->assertEquals( 1, $result['meta']['total'] );
47
-		$this->assertEquals( 1, count( $result['data'] ) );
48
-		$this->assertEquals( 'locale/site', $result['data'][0]['type'] );
49
-		$this->assertEquals( 0, count( $result['included'] ) );
46
+		$this->assertEquals(1, $result['meta']['total']);
47
+		$this->assertEquals(1, count($result['data']));
48
+		$this->assertEquals('locale/site', $result['data'][0]['type']);
49
+		$this->assertEquals(0, count($result['included']));
50 50
 
51
-		$this->assertArrayNotHasKey( 'errors', $result );
51
+		$this->assertArrayNotHasKey('errors', $result);
52 52
 	}
53 53
 
54 54
 
55 55
 	public function testGetTree()
56 56
 	{
57 57
 		$params = array(
58
-			'id' => $this->getSiteItem( 'unittest' )->getId(),
58
+			'id' => $this->getSiteItem('unittest')->getId(),
59 59
 			'filter' => array(
60
-				'==' => array( 'locale.status' => 0 )
60
+				'==' => array('locale.status' => 0)
61 61
 			),
62 62
 			'include' => 'locale/site'
63 63
 		);
64
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
65
-		$this->view->addHelper( 'param', $helper );
64
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
65
+		$this->view->addHelper('param', $helper);
66 66
 
67
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
68
-		$result = json_decode( (string) $response->getBody(), true );
67
+		$response = $this->object->get($this->view->request(), $this->view->response());
68
+		$result = json_decode((string) $response->getBody(), true);
69 69
 
70 70
 
71
-		$this->assertEquals( 200, $response->getStatusCode() );
72
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
71
+		$this->assertEquals(200, $response->getStatusCode());
72
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
73 73
 
74
-		$this->assertEquals( 1, $result['meta']['total'] );
75
-		$this->assertEquals( 'locale/site', $result['data']['type'] );
76
-		$this->assertEquals( 0, count( $result['included'] ) );
74
+		$this->assertEquals(1, $result['meta']['total']);
75
+		$this->assertEquals('locale/site', $result['data']['type']);
76
+		$this->assertEquals(0, count($result['included']));
77 77
 
78
-		$this->assertArrayNotHasKey( 'errors', $result );
78
+		$this->assertArrayNotHasKey('errors', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testPatch()
83 83
 	{
84
-		$stub = $this->getSiteMock( array( 'getItem', 'moveItem', 'saveItem' ) );
84
+		$stub = $this->getSiteMock(array('getItem', 'moveItem', 'saveItem'));
85 85
 		$item = $stub->createItem();
86 86
 
87
-		$stub->expects( $this->once() )->method( 'moveItem' );
88
-		$stub->expects( $this->once() )->method( 'saveItem' );
89
-		$stub->expects( $this->exactly( 2 ) )->method( 'getItem' ) // 2x due to decorator
90
-			->will( $this->returnValue( $item ) );
87
+		$stub->expects($this->once())->method('moveItem');
88
+		$stub->expects($this->once())->method('saveItem');
89
+		$stub->expects($this->exactly(2))->method('getItem') // 2x due to decorator
90
+			->will($this->returnValue($item));
91 91
 
92 92
 
93
-		$params = array( 'id' => '-1' );
94
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params );
95
-		$this->view->addHelper( 'param', $helper );
93
+		$params = array('id' => '-1');
94
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params);
95
+		$this->view->addHelper('param', $helper);
96 96
 
97 97
 		$body = '{"data": {"parentid": "1", "targetid": 2, "type": "locale/site", "attributes": {"locale.site.label": "test"}}}';
98
-		$request = $this->view->request()->withBody( $this->view->response()->createStreamFromString( $body ) );
98
+		$request = $this->view->request()->withBody($this->view->response()->createStreamFromString($body));
99 99
 
100
-		$response = $this->object->patch( $request, $this->view->response() );
101
-		$result = json_decode( (string) $response->getBody(), true );
100
+		$response = $this->object->patch($request, $this->view->response());
101
+		$result = json_decode((string) $response->getBody(), true);
102 102
 
103 103
 
104
-		$this->assertEquals( 200, $response->getStatusCode() );
105
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
104
+		$this->assertEquals(200, $response->getStatusCode());
105
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
106 106
 
107
-		$this->assertEquals( 1, $result['meta']['total'] );
108
-		$this->assertArrayHasKey( 'data', $result );
109
-		$this->assertEquals( 'locale/site', $result['data']['type'] );
107
+		$this->assertEquals(1, $result['meta']['total']);
108
+		$this->assertArrayHasKey('data', $result);
109
+		$this->assertEquals('locale/site', $result['data']['type']);
110 110
 
111
-		$this->assertArrayNotHasKey( 'included', $result );
112
-		$this->assertArrayNotHasKey( 'errors', $result );
111
+		$this->assertArrayNotHasKey('included', $result);
112
+		$this->assertArrayNotHasKey('errors', $result);
113 113
 	}
114 114
 
115 115
 
116 116
 	public function testPost()
117 117
 	{
118
-		$stub = $this->getSiteMock( array( 'getItem', 'insertItem' ) );
118
+		$stub = $this->getSiteMock(array('getItem', 'insertItem'));
119 119
 		$item = $stub->createItem();
120 120
 
121
-		$stub->expects( $this->any() )->method( 'getItem' )
122
-			->will( $this->returnValue( $item ) );
123
-		$stub->expects( $this->once() )->method( 'insertItem' );
121
+		$stub->expects($this->any())->method('getItem')
122
+			->will($this->returnValue($item));
123
+		$stub->expects($this->once())->method('insertItem');
124 124
 
125 125
 
126 126
 		$body = '{"data": {"type": "locale/site", "attributes": {"locale.site.code": "unittest", "locale.site.label": "Unit test"}}}';
127
-		$request = $this->view->request()->withBody( $this->view->response()->createStreamFromString( $body ) );
127
+		$request = $this->view->request()->withBody($this->view->response()->createStreamFromString($body));
128 128
 
129
-		$response = $this->object->post( $request, $this->view->response() );
130
-		$result = json_decode( (string) $response->getBody(), true );
129
+		$response = $this->object->post($request, $this->view->response());
130
+		$result = json_decode((string) $response->getBody(), true);
131 131
 
132 132
 
133
-		$this->assertEquals( 201, $response->getStatusCode() );
134
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
133
+		$this->assertEquals(201, $response->getStatusCode());
134
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
135 135
 
136
-		$this->assertEquals( 1, $result['meta']['total'] );
137
-		$this->assertArrayHasKey( 'data', $result );
138
-		$this->assertEquals( 'locale/site', $result['data']['type'] );
136
+		$this->assertEquals(1, $result['meta']['total']);
137
+		$this->assertArrayHasKey('data', $result);
138
+		$this->assertEquals('locale/site', $result['data']['type']);
139 139
 
140
-		$this->assertArrayNotHasKey( 'included', $result );
141
-		$this->assertArrayNotHasKey( 'errors', $result );
140
+		$this->assertArrayNotHasKey('included', $result);
141
+		$this->assertArrayNotHasKey('errors', $result);
142 142
 	}
143 143
 
144 144
 
145
-	protected function getSiteItem( $code )
145
+	protected function getSiteItem($code)
146 146
 	{
147
-		$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $this->context )->getSubManager( 'site' );
147
+		$manager = \Aimeos\MShop\Locale\Manager\Factory::createManager($this->context)->getSubManager('site');
148 148
 		$search = $manager->createSearch();
149
-		$search->setConditions( $search->compare( '==', 'locale.site.code', $code ) );
150
-		$items = $manager->searchItems( $search );
149
+		$search->setConditions($search->compare('==', 'locale.site.code', $code));
150
+		$items = $manager->searchItems($search);
151 151
 
152
-		if( ( $item = reset( $items ) ) === false ) {
153
-			throw new \RuntimeException( sprintf( 'No locale site item with code "%1$s" found', $code ) );
152
+		if (($item = reset($items)) === false) {
153
+			throw new \RuntimeException(sprintf('No locale site item with code "%1$s" found', $code));
154 154
 		}
155 155
 
156 156
 		return $item;
157 157
 	}
158 158
 
159 159
 
160
-	protected function getSiteMock( array $methods )
160
+	protected function getSiteMock(array $methods)
161 161
 	{
162 162
 		$name = 'ClientJsonAdmStandard';
163
-		$this->context->getConfig()->set( 'mshop/locale/manager/name', $name );
163
+		$this->context->getConfig()->set('mshop/locale/manager/name', $name);
164 164
 
165
-		$stub = $this->getMockBuilder( '\\Aimeos\\MShop\\Locale\\Manager\\Standard' )
166
-			->setConstructorArgs( array( $this->context ) )
167
-			->setMethods( array( 'getSubManager' ) )
165
+		$stub = $this->getMockBuilder('\\Aimeos\\MShop\\Locale\\Manager\\Standard')
166
+			->setConstructorArgs(array($this->context))
167
+			->setMethods(array('getSubManager'))
168 168
 			->getMock();
169 169
 
170
-		$siteStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Locale\\Manager\\Site\\Standard' )
171
-			->setConstructorArgs( array( $this->context ) )
172
-			->setMethods( $methods )
170
+		$siteStub = $this->getMockBuilder('\\Aimeos\\MShop\\Locale\\Manager\\Site\\Standard')
171
+			->setConstructorArgs(array($this->context))
172
+			->setMethods($methods)
173 173
 			->getMock();
174 174
 
175
-		$stub->expects( $this->once() )->method( 'getSubManager' )
176
-			->will( $this->returnValue( $siteStub ) );
175
+		$stub->expects($this->once())->method('getSubManager')
176
+			->will($this->returnValue($siteStub));
177 177
 
178
-		\Aimeos\MShop\Locale\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Locale\\Manager\\' . $name, $stub );
178
+		\Aimeos\MShop\Locale\Manager\Factory::injectManager('\\Aimeos\\MShop\\Locale\\Manager\\' . $name, $stub);
179 179
 
180 180
 		return $siteStub;
181 181
 	}
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Media/StandardTest.php 1 patch
Spacing   +14 added lines, -14 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,26 +30,26 @@  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
-		$response = $this->object->get( $this->view->request(), $this->view->response() );
41
-		$result = json_decode( (string) $response->getBody(), true );
40
+		$response = $this->object->get($this->view->request(), $this->view->response());
41
+		$result = json_decode((string) $response->getBody(), true);
42 42
 
43 43
 
44
-		$this->assertEquals( 200, $response->getStatusCode() );
45
-		$this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) );
44
+		$this->assertEquals(200, $response->getStatusCode());
45
+		$this->assertEquals(1, count($response->getHeader('Content-Type')));
46 46
 
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'] ) );
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 52
 
53
-		$this->assertArrayNotHasKey( 'errors', $result );
53
+		$this->assertArrayNotHasKey('errors', $result);
54 54
 	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
admin/jsonadm/tests/Admin/JsonAdm/Common/Decorator/BaseTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -21,95 +21,95 @@
 block discarded – undo
21 21
 		$context = \TestHelperJadm::getContext();
22 22
 		$this->view = $context->getView();
23 23
 
24
-		$this->stub = $this->getMockBuilder( '\\Aimeos\\Admin\\JsonAdm\\Standard' )
25
-			->setConstructorArgs( array( $context, $this->view, array(), 'attribute' ) )
24
+		$this->stub = $this->getMockBuilder('\\Aimeos\\Admin\\JsonAdm\\Standard')
25
+			->setConstructorArgs(array($context, $this->view, array(), 'attribute'))
26 26
 			->getMock();
27 27
 
28
-		$this->object = new TestBase( $this->stub, $context, $this->view, array(), 'attribute' );
28
+		$this->object = new TestBase($this->stub, $context, $this->view, array(), 'attribute');
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object, $this->stub );
34
+		unset($this->object, $this->stub);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testDelete()
39 39
 	{
40
-		$this->stub->expects( $this->once() )->method( 'delete' )->will( $this->returnArgument( 1 ) );
40
+		$this->stub->expects($this->once())->method('delete')->will($this->returnArgument(1));
41 41
 		$response = $this->view->response();
42 42
 
43
-		$this->assertSame( $response, $this->object->delete( $this->view->request(), $response ) );
43
+		$this->assertSame($response, $this->object->delete($this->view->request(), $response));
44 44
 	}
45 45
 
46 46
 
47 47
 	public function testGet()
48 48
 	{
49
-		$this->stub->expects( $this->once() )->method( 'get' )->will( $this->returnArgument( 1 ) );
49
+		$this->stub->expects($this->once())->method('get')->will($this->returnArgument(1));
50 50
 		$response = $this->view->response();
51 51
 
52
-		$this->assertSame( $response, $this->object->get( $this->view->request(), $response ) );
52
+		$this->assertSame($response, $this->object->get($this->view->request(), $response));
53 53
 	}
54 54
 
55 55
 
56 56
 	public function testPatch()
57 57
 	{
58
-		$this->stub->expects( $this->once() )->method( 'patch' )->will( $this->returnArgument( 1 ) );
58
+		$this->stub->expects($this->once())->method('patch')->will($this->returnArgument(1));
59 59
 		$response = $this->view->response();
60 60
 
61
-		$this->assertSame( $response, $this->object->patch( $this->view->request(), $response ) );
61
+		$this->assertSame($response, $this->object->patch($this->view->request(), $response));
62 62
 	}
63 63
 
64 64
 
65 65
 	public function testPost()
66 66
 	{
67
-		$this->stub->expects( $this->once() )->method( 'post' )->will( $this->returnArgument( 1 ) );
67
+		$this->stub->expects($this->once())->method('post')->will($this->returnArgument(1));
68 68
 		$response = $this->view->response();
69 69
 
70
-		$this->assertSame( $response, $this->object->post( $this->view->request(), $response ) );
70
+		$this->assertSame($response, $this->object->post($this->view->request(), $response));
71 71
 	}
72 72
 
73 73
 
74 74
 	public function testPut()
75 75
 	{
76
-		$this->stub->expects( $this->once() )->method( 'put' )->will( $this->returnArgument( 1 ) );
76
+		$this->stub->expects($this->once())->method('put')->will($this->returnArgument(1));
77 77
 		$response = $this->view->response();
78 78
 
79
-		$this->assertSame( $response, $this->object->put( $this->view->request(), $response ) );
79
+		$this->assertSame($response, $this->object->put($this->view->request(), $response));
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testOptions()
84 84
 	{
85
-		$this->stub->expects( $this->once() )->method( 'options' )->will( $this->returnArgument( 1 ) );
85
+		$this->stub->expects($this->once())->method('options')->will($this->returnArgument(1));
86 86
 		$response = $this->view->response();
87 87
 
88
-		$this->assertSame( $response, $this->object->options( $this->view->request(), $response ) );
88
+		$this->assertSame($response, $this->object->options($this->view->request(), $response));
89 89
 	}
90 90
 
91 91
 
92 92
 	public function testGetContext()
93 93
 	{
94
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->object->getContextPublic() );
94
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Context\\Item\\Iface', $this->object->getContextPublic());
95 95
 	}
96 96
 
97 97
 
98 98
 	public function testGetTemplatePaths()
99 99
 	{
100
-		$this->assertEquals( array(), $this->object->getTemplatePathsPublic() );
100
+		$this->assertEquals(array(), $this->object->getTemplatePathsPublic());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testGetPath()
105 105
 	{
106
-		$this->assertEquals( 'attribute', $this->object->getPathPublic() );
106
+		$this->assertEquals('attribute', $this->object->getPathPublic());
107 107
 	}
108 108
 
109 109
 
110 110
 	public function testCall()
111 111
 	{
112
-		$this->markTestIncomplete( 'PHP warning is triggered instead of exception' );
112
+		$this->markTestIncomplete('PHP warning is triggered instead of exception');
113 113
 	}
114 114
 
115 115
 }
Please login to merge, or discard this patch.