@@ -22,7 +22,7 @@ discard block |
||
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 |
||
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 |
@@ -21,95 +21,95 @@ |
||
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 | } |
@@ -22,7 +22,7 @@ discard block |
||
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,26 +30,26 @@ discard block |
||
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 | - $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( 'attribute', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['text'] ) ); |
|
51 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
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 | 52 | |
53 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
53 | + $this->assertArrayNotHasKey('errors', $result); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
23 | 23 | $this->view = $this->context->getView(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JsonAdm\Product\Standard( $this->context, $this->view, $templatePaths, 'product' ); |
|
25 | + $this->object = new \Aimeos\Admin\JsonAdm\Product\Standard($this->context, $this->view, $templatePaths, 'product'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -30,34 +30,34 @@ discard block |
||
30 | 30 | { |
31 | 31 | $params = array( |
32 | 32 | 'filter' => array( |
33 | - '==' => array( 'product.code' => 'CNE' ) |
|
33 | + '==' => array('product.code' => 'CNE') |
|
34 | 34 | ), |
35 | 35 | 'include' => 'text,product,product/property' |
36 | 36 | ); |
37 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
38 | - $this->view->addHelper( 'param', $helper ); |
|
39 | - |
|
40 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
41 | - $result = json_decode( (string) $response->getBody(), true ); |
|
42 | - |
|
43 | - |
|
44 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
45 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
46 | - |
|
47 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
48 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
49 | - $this->assertEquals( 'product', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 6, count( $result['data'][0]['relationships']['text'] ) ); |
|
51 | - $this->assertArrayHaskey( 'self', $result['data'][0]['relationships']['text'][0]['data']['links'] ); |
|
52 | - $this->assertEquals( 5, count( $result['data'][0]['relationships']['product'] ) ); |
|
53 | - $this->assertArrayHaskey( 'self', $result['data'][0]['relationships']['product'][0]['data']['links'] ); |
|
54 | - $this->assertEquals( 4, count( $result['data'][0]['relationships']['product/property'] ) ); |
|
55 | - $this->assertEquals( 14, count( $result['included'] ) ); |
|
56 | - $this->assertEquals( 'product/property', $result['included'][0]['type'] ); |
|
57 | - $this->assertArrayHaskey( 'self', $result['included'][0]['links'] ); |
|
58 | - $this->assertArrayHaskey( 'related', $result['included'][0]['links'] ); |
|
59 | - |
|
60 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
37 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
38 | + $this->view->addHelper('param', $helper); |
|
39 | + |
|
40 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
41 | + $result = json_decode((string) $response->getBody(), true); |
|
42 | + |
|
43 | + |
|
44 | + $this->assertEquals(200, $response->getStatusCode()); |
|
45 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
46 | + |
|
47 | + $this->assertEquals(1, $result['meta']['total']); |
|
48 | + $this->assertEquals(1, count($result['data'])); |
|
49 | + $this->assertEquals('product', $result['data'][0]['type']); |
|
50 | + $this->assertEquals(6, count($result['data'][0]['relationships']['text'])); |
|
51 | + $this->assertArrayHaskey('self', $result['data'][0]['relationships']['text'][0]['data']['links']); |
|
52 | + $this->assertEquals(5, count($result['data'][0]['relationships']['product'])); |
|
53 | + $this->assertArrayHaskey('self', $result['data'][0]['relationships']['product'][0]['data']['links']); |
|
54 | + $this->assertEquals(4, count($result['data'][0]['relationships']['product/property'])); |
|
55 | + $this->assertEquals(14, count($result['included'])); |
|
56 | + $this->assertEquals('product/property', $result['included'][0]['type']); |
|
57 | + $this->assertArrayHaskey('self', $result['included'][0]['links']); |
|
58 | + $this->assertArrayHaskey('related', $result['included'][0]['links']); |
|
59 | + |
|
60 | + $this->assertArrayNotHasKey('errors', $result); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -70,23 +70,23 @@ discard block |
||
70 | 70 | 'sort' => 'product.id', |
71 | 71 | 'include' => 'product,product/property' |
72 | 72 | ); |
73 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
74 | - $this->view->addHelper( 'param', $helper ); |
|
73 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
74 | + $this->view->addHelper('param', $helper); |
|
75 | 75 | |
76 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
77 | - $result = json_decode( (string) $response->getBody(), true ); |
|
76 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
77 | + $result = json_decode((string) $response->getBody(), true); |
|
78 | 78 | |
79 | 79 | |
80 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
81 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
80 | + $this->assertEquals(200, $response->getStatusCode()); |
|
81 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
82 | 82 | |
83 | - $this->assertEquals( 28, $result['meta']['total'] ); |
|
84 | - $this->assertEquals( 25, count( $result['data'] ) ); |
|
85 | - $this->assertEquals( 'product', $result['data'][0]['type'] ); |
|
86 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
87 | - $this->assertEquals( 5, count( $result['data'][0]['relationships']['product'] ) ); |
|
88 | - $this->assertEquals( 21, count( $result['included'] ) ); |
|
83 | + $this->assertEquals(28, $result['meta']['total']); |
|
84 | + $this->assertEquals(25, count($result['data'])); |
|
85 | + $this->assertEquals('product', $result['data'][0]['type']); |
|
86 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
87 | + $this->assertEquals(5, count($result['data'][0]['relationships']['product'])); |
|
88 | + $this->assertEquals(21, count($result['included'])); |
|
89 | 89 | |
90 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
90 | + $this->assertArrayNotHasKey('errors', $result); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
23 | 23 | $this->view = $this->context->getView(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Standard( $this->context, $this->view, $templatePaths, 'coupon' ); |
|
25 | + $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Standard($this->context, $this->view, $templatePaths, 'coupon'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -30,27 +30,27 @@ discard block |
||
30 | 30 | { |
31 | 31 | $params = array( |
32 | 32 | 'filter' => array( |
33 | - '==' => array( 'coupon.code.code' => '90AB' ) |
|
33 | + '==' => array('coupon.code.code' => '90AB') |
|
34 | 34 | ), |
35 | 35 | 'include' => 'coupon/code' |
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( 'coupon', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['coupon/code'] ) ); |
|
51 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
47 | + $this->assertEquals(1, $result['meta']['total']); |
|
48 | + $this->assertEquals(1, count($result['data'])); |
|
49 | + $this->assertEquals('coupon', $result['data'][0]['type']); |
|
50 | + $this->assertEquals(1, count($result['data'][0]['relationships']['coupon/code'])); |
|
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 | |
@@ -63,22 +63,22 @@ discard block |
||
63 | 63 | 'sort' => 'coupon.id', |
64 | 64 | 'include' => 'coupon/code' |
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( 5, $result['meta']['total'] ); |
|
77 | - $this->assertEquals( 5, count( $result['data'] ) ); |
|
78 | - $this->assertEquals( 'coupon', $result['data'][0]['type'] ); |
|
79 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
80 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['coupon/code'] ) ); |
|
81 | - $this->assertEquals( 5, count( $result['included'] ) ); |
|
82 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
76 | + $this->assertEquals(5, $result['meta']['total']); |
|
77 | + $this->assertEquals(5, count($result['data'])); |
|
78 | + $this->assertEquals('coupon', $result['data'][0]['type']); |
|
79 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
80 | + $this->assertEquals(1, count($result['data'][0]['relationships']['coupon/code'])); |
|
81 | + $this->assertEquals(5, count($result['included'])); |
|
82 | + $this->assertArrayNotHasKey('errors', $result); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $templatePaths = \TestHelperJadm::getJsonadmPaths(); |
23 | 23 | $this->view = $this->context->getView(); |
24 | 24 | |
25 | - $this->object = new \Aimeos\Admin\JsonAdm\Customer\Standard( $this->context, $this->view, $templatePaths, 'customer' ); |
|
25 | + $this->object = new \Aimeos\Admin\JsonAdm\Customer\Standard($this->context, $this->view, $templatePaths, 'customer'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -30,28 +30,28 @@ discard block |
||
30 | 30 | { |
31 | 31 | $params = array( |
32 | 32 | 'filter' => array( |
33 | - '==' => array( 'customer.code' => 'UTC001' ) |
|
33 | + '==' => array('customer.code' => 'UTC001') |
|
34 | 34 | ), |
35 | 35 | 'include' => 'text,customer/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( 'customer', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['text'] ) ); |
|
51 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['customer/address'] ) ); |
|
52 | - $this->assertEquals( 2, count( $result['included'] ) ); |
|
47 | + $this->assertEquals(1, $result['meta']['total']); |
|
48 | + $this->assertEquals(1, count($result['data'])); |
|
49 | + $this->assertEquals('customer', $result['data'][0]['type']); |
|
50 | + $this->assertEquals(1, count($result['data'][0]['relationships']['text'])); |
|
51 | + $this->assertEquals(1, count($result['data'][0]['relationships']['customer/address'])); |
|
52 | + $this->assertEquals(2, count($result['included'])); |
|
53 | 53 | |
54 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
54 | + $this->assertArrayNotHasKey('errors', $result); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $params = array( |
61 | 61 | 'filter' => array( |
62 | - '=~' => array( 'customer.code' => 'UTC' ) |
|
62 | + '=~' => array('customer.code' => 'UTC') |
|
63 | 63 | ), |
64 | 64 | 'fields' => array( |
65 | 65 | 'customer' => 'customer.id,customer.label' |
@@ -67,23 +67,23 @@ discard block |
||
67 | 67 | 'sort' => 'customer.id', |
68 | 68 | 'include' => 'customer/address' |
69 | 69 | ); |
70 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
71 | - $this->view->addHelper( 'param', $helper ); |
|
70 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
71 | + $this->view->addHelper('param', $helper); |
|
72 | 72 | |
73 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
74 | - $result = json_decode( (string) $response->getBody(), true ); |
|
73 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
74 | + $result = json_decode((string) $response->getBody(), true); |
|
75 | 75 | |
76 | 76 | |
77 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
78 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
77 | + $this->assertEquals(200, $response->getStatusCode()); |
|
78 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
79 | 79 | |
80 | - $this->assertEquals( 3, $result['meta']['total'] ); |
|
81 | - $this->assertEquals( 3, count( $result['data'] ) ); |
|
82 | - $this->assertEquals( 'customer', $result['data'][0]['type'] ); |
|
83 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
84 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['customer/address'] ) ); |
|
85 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
80 | + $this->assertEquals(3, $result['meta']['total']); |
|
81 | + $this->assertEquals(3, count($result['data'])); |
|
82 | + $this->assertEquals('customer', $result['data'][0]['type']); |
|
83 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
84 | + $this->assertEquals(1, count($result['data'][0]['relationships']['customer/address'])); |
|
85 | + $this->assertEquals(4, count($result['included'])); |
|
86 | 86 | |
87 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
87 | + $this->assertArrayNotHasKey('errors', $result); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
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,26 +30,26 @@ discard block |
||
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 | - $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( 'text', $result['data'][0]['type'] ); |
|
50 | - $this->assertEquals( 4, count( $result['data'][0]['relationships']['media'] ) ); |
|
51 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
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 | 52 | |
53 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
53 | + $this->assertArrayNotHasKey('errors', $result); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
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,26 +30,26 @@ discard block |
||
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 | - $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( 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'] ) ); |
|
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 | 52 | |
53 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
53 | + $this->assertArrayNotHasKey('errors', $result); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -15,15 +15,15 @@ discard block |
||
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 |
||
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,85 +47,85 @@ discard block |
||
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 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() ); |
|
125 | - $view->addHelper( 'request', $helper ); |
|
124 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest()); |
|
125 | + $view->addHelper('request', $helper); |
|
126 | 126 | |
127 | - $helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() ); |
|
128 | - $view->addHelper( 'response', $helper ); |
|
127 | + $helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response()); |
|
128 | + $view->addHelper('response', $helper); |
|
129 | 129 | |
130 | 130 | return $view; |
131 | 131 | } |