@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Plugin\Config\Standard( $this->context, 'plugin/config' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Plugin\Config\Standard($this->context, 'plugin/config'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -32,26 +32,26 @@ discard block |
||
32 | 32 | $params = array( |
33 | 33 | 'id' => 'Autofill,Log', |
34 | 34 | ); |
35 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
36 | - $this->view->addHelper( 'param', $helper ); |
|
37 | - |
|
38 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
39 | - $result = json_decode( (string) $response->getBody(), true ); |
|
40 | - |
|
41 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
42 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
43 | - |
|
44 | - $this->assertEquals( 8, $result['meta']['total'] ); |
|
45 | - $this->assertInternalType( 'array', $result['data'] ); |
|
46 | - $this->assertEquals( 'autofill.address', $result['data'][0]['id'] ); |
|
47 | - $this->assertEquals( 'autofill.delivery', $result['data'][1]['id'] ); |
|
48 | - $this->assertEquals( 'autofill.deliverycode', $result['data'][2]['id'] ); |
|
49 | - $this->assertEquals( 'autofill.payment', $result['data'][3]['id'] ); |
|
50 | - $this->assertEquals( 'autofill.paymentcode', $result['data'][4]['id'] ); |
|
51 | - $this->assertEquals( 'autofill.useorder', $result['data'][5]['id'] ); |
|
52 | - $this->assertEquals( 'autofill.orderaddress', $result['data'][6]['id'] ); |
|
53 | - $this->assertEquals( 'autofill.orderservice', $result['data'][7]['id'] ); |
|
54 | - |
|
55 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
35 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
36 | + $this->view->addHelper('param', $helper); |
|
37 | + |
|
38 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
39 | + $result = json_decode((string) $response->getBody(), true); |
|
40 | + |
|
41 | + $this->assertEquals(200, $response->getStatusCode()); |
|
42 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
43 | + |
|
44 | + $this->assertEquals(8, $result['meta']['total']); |
|
45 | + $this->assertInternalType('array', $result['data']); |
|
46 | + $this->assertEquals('autofill.address', $result['data'][0]['id']); |
|
47 | + $this->assertEquals('autofill.delivery', $result['data'][1]['id']); |
|
48 | + $this->assertEquals('autofill.deliverycode', $result['data'][2]['id']); |
|
49 | + $this->assertEquals('autofill.payment', $result['data'][3]['id']); |
|
50 | + $this->assertEquals('autofill.paymentcode', $result['data'][4]['id']); |
|
51 | + $this->assertEquals('autofill.useorder', $result['data'][5]['id']); |
|
52 | + $this->assertEquals('autofill.orderaddress', $result['data'][6]['id']); |
|
53 | + $this->assertEquals('autofill.orderservice', $result['data'][7]['id']); |
|
54 | + |
|
55 | + $this->assertArrayNotHasKey('errors', $result); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | \ No newline at end of file |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | $context = \TestHelperJadm::getContext(); |
17 | 17 | $aimeos = \TestHelperJadm::getAimeos(); |
18 | 18 | |
19 | - $client = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
20 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client ); |
|
21 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Order\\Standard', $client ); |
|
19 | + $client = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
20 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client); |
|
21 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Order\\Standard', $client); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | $context = \TestHelperJadm::getContext(); |
28 | 28 | $aimeos = \TestHelperJadm::getAimeos(); |
29 | 29 | |
30 | - $client = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order/base' ); |
|
31 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client ); |
|
32 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Order\\Base\\Standard', $client ); |
|
30 | + $client = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order/base'); |
|
31 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client); |
|
32 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Order\\Base\\Standard', $client); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $context = \TestHelperJadm::getContext(); |
39 | 39 | $aimeos = \TestHelperJadm::getAimeos(); |
40 | 40 | |
41 | - $client = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'stock/type' ); |
|
42 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client ); |
|
43 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Standard', $client ); |
|
41 | + $client = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'stock/type'); |
|
42 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client); |
|
43 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Standard', $client); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | $context = \TestHelperJadm::getContext(); |
50 | 50 | $aimeos = \TestHelperJadm::getAimeos(); |
51 | 51 | |
52 | - $client = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, '' ); |
|
53 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client ); |
|
54 | - $this->assertInstanceOf( '\\Aimeos\\Admin\\JsonAdm\\Standard', $client ); |
|
52 | + $client = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, ''); |
|
53 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Common\\Iface', $client); |
|
54 | + $this->assertInstanceOf('\\Aimeos\\Admin\\JsonAdm\\Standard', $client); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $context = \TestHelperJadm::getContext(); |
61 | 61 | $aimeos = \TestHelperJadm::getAimeos(); |
62 | 62 | |
63 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
64 | - \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, '%^' ); |
|
63 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
64 | + \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, '%^'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
@@ -70,68 +70,68 @@ discard block |
||
70 | 70 | $context = \TestHelperJadm::getContext(); |
71 | 71 | $aimeos = \TestHelperJadm::getAimeos(); |
72 | 72 | |
73 | - $this->setExpectedException( '\\Aimeos\\Admin\\JsonAdm\\Exception' ); |
|
74 | - \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, '', '%^' ); |
|
73 | + $this->setExpectedException('\\Aimeos\\Admin\\JsonAdm\\Exception'); |
|
74 | + \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, '', '%^'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testClear() |
79 | 79 | { |
80 | - $cache = \Aimeos\Admin\JsonAdm\Factory::setCache( true ); |
|
80 | + $cache = \Aimeos\Admin\JsonAdm\Factory::setCache(true); |
|
81 | 81 | |
82 | 82 | $context = \TestHelperJadm::getContext(); |
83 | 83 | $aimeos = \TestHelperJadm::getAimeos(); |
84 | 84 | |
85 | - $client1 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
85 | + $client1 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
86 | 86 | \Aimeos\Admin\JsonAdm\Factory::clear(); |
87 | - $client2 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
87 | + $client2 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
88 | 88 | |
89 | - \Aimeos\Admin\JsonAdm\Factory::setCache( $cache ); |
|
89 | + \Aimeos\Admin\JsonAdm\Factory::setCache($cache); |
|
90 | 90 | |
91 | - $this->assertNotSame( $client1, $client2 ); |
|
91 | + $this->assertNotSame($client1, $client2); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | |
95 | 95 | public function testClearSite() |
96 | 96 | { |
97 | - $cache = \Aimeos\Admin\JsonAdm\Factory::setCache( true ); |
|
97 | + $cache = \Aimeos\Admin\JsonAdm\Factory::setCache(true); |
|
98 | 98 | |
99 | 99 | $context = \TestHelperJadm::getContext(); |
100 | 100 | $aimeos = \TestHelperJadm::getAimeos(); |
101 | 101 | |
102 | - $cntlA1 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
103 | - $cntlB1 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order/base' ); |
|
104 | - \Aimeos\Admin\JsonAdm\Factory::clear( (string) $context ); |
|
102 | + $cntlA1 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
103 | + $cntlB1 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order/base'); |
|
104 | + \Aimeos\Admin\JsonAdm\Factory::clear((string) $context); |
|
105 | 105 | |
106 | - $cntlA2 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
107 | - $cntlB2 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order/base' ); |
|
106 | + $cntlA2 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
107 | + $cntlB2 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order/base'); |
|
108 | 108 | |
109 | - \Aimeos\Admin\JsonAdm\Factory::setCache( $cache ); |
|
109 | + \Aimeos\Admin\JsonAdm\Factory::setCache($cache); |
|
110 | 110 | |
111 | - $this->assertNotSame( $cntlA1, $cntlA2 ); |
|
112 | - $this->assertNotSame( $cntlB1, $cntlB2 ); |
|
111 | + $this->assertNotSame($cntlA1, $cntlA2); |
|
112 | + $this->assertNotSame($cntlB1, $cntlB2); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | 116 | public function testClearSpecific() |
117 | 117 | { |
118 | - $cache = \Aimeos\Admin\JsonAdm\Factory::setCache( true ); |
|
118 | + $cache = \Aimeos\Admin\JsonAdm\Factory::setCache(true); |
|
119 | 119 | |
120 | 120 | $context = \TestHelperJadm::getContext(); |
121 | 121 | $aimeos = \TestHelperJadm::getAimeos(); |
122 | 122 | |
123 | - $cntlA1 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
124 | - $cntlB1 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order/base' ); |
|
123 | + $cntlA1 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
124 | + $cntlB1 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order/base'); |
|
125 | 125 | |
126 | - \Aimeos\Admin\JsonAdm\Factory::clear( (string) $context, 'order' ); |
|
126 | + \Aimeos\Admin\JsonAdm\Factory::clear((string) $context, 'order'); |
|
127 | 127 | |
128 | - $cntlA2 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order' ); |
|
129 | - $cntlB2 = \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, 'order/base' ); |
|
128 | + $cntlA2 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order'); |
|
129 | + $cntlB2 = \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, 'order/base'); |
|
130 | 130 | |
131 | - \Aimeos\Admin\JsonAdm\Factory::setCache( $cache ); |
|
131 | + \Aimeos\Admin\JsonAdm\Factory::setCache($cache); |
|
132 | 132 | |
133 | - $this->assertNotSame( $cntlA1, $cntlA2 ); |
|
134 | - $this->assertSame( $cntlB1, $cntlB2 ); |
|
133 | + $this->assertNotSame($cntlA1, $cntlA2); |
|
134 | + $this->assertSame($cntlB1, $cntlB2); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | } |
138 | 138 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard( $this->context, 'attribute' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Attribute\Standard($this->context, 'attribute'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,26 +31,26 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'attribute.code' => 's' ) |
|
34 | + '==' => array('attribute.code' => 's') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'text' |
37 | 37 | ); |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
39 | - $this->view->addHelper( 'param', $helper ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
39 | + $this->view->addHelper('param', $helper); |
|
40 | 40 | |
41 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
42 | - $result = json_decode( (string) $response->getBody(), true ); |
|
41 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
42 | + $result = json_decode((string) $response->getBody(), true); |
|
43 | 43 | |
44 | 44 | |
45 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
46 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
45 | + $this->assertEquals(200, $response->getStatusCode()); |
|
46 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
47 | 47 | |
48 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
49 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
50 | - $this->assertEquals( 'attribute', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['text'] ) ); |
|
52 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
48 | + $this->assertEquals(1, $result['meta']['total']); |
|
49 | + $this->assertEquals(1, count($result['data'])); |
|
50 | + $this->assertEquals('attribute', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(1, count($result['data'][0]['relationships']['text'])); |
|
52 | + $this->assertEquals(1, count($result['included'])); |
|
53 | 53 | |
54 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
54 | + $this->assertArrayNotHasKey('errors', $result); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Text\Standard( $this->context, 'text' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Text\Standard($this->context, 'text'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,26 +31,26 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'text.label' => 'misc_long_desc' ) |
|
34 | + '==' => array('text.label' => 'misc_long_desc') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'media' |
37 | 37 | ); |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
39 | - $this->view->addHelper( 'param', $helper ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
39 | + $this->view->addHelper('param', $helper); |
|
40 | 40 | |
41 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
42 | - $result = json_decode( (string) $response->getBody(), true ); |
|
41 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
42 | + $result = json_decode((string) $response->getBody(), true); |
|
43 | 43 | |
44 | 44 | |
45 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
46 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
45 | + $this->assertEquals(200, $response->getStatusCode()); |
|
46 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
47 | 47 | |
48 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
49 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
50 | - $this->assertEquals( 'text', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 4, count( $result['data'][0]['relationships']['media'] ) ); |
|
52 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
48 | + $this->assertEquals(1, $result['meta']['total']); |
|
49 | + $this->assertEquals(1, count($result['data'])); |
|
50 | + $this->assertEquals('text', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(4, count($result['data'][0]['relationships']['media'])); |
|
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 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Price\Standard( $this->context, 'price' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Price\Standard($this->context, 'price'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,26 +31,26 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'price.value' => '12.95' ) |
|
34 | + '==' => array('price.value' => '12.95') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'attribute' |
37 | 37 | ); |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
39 | - $this->view->addHelper( 'param', $helper ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
39 | + $this->view->addHelper('param', $helper); |
|
40 | 40 | |
41 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
42 | - $result = json_decode( (string) $response->getBody(), true ); |
|
41 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
42 | + $result = json_decode((string) $response->getBody(), true); |
|
43 | 43 | |
44 | 44 | |
45 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
46 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
45 | + $this->assertEquals(200, $response->getStatusCode()); |
|
46 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
47 | 47 | |
48 | - $this->assertEquals( 2, $result['meta']['total'] ); |
|
49 | - $this->assertEquals( 2, count( $result['data'] ) ); |
|
50 | - $this->assertEquals( 'price', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 0, count( $result['data'][0]['relationships'] ) ); |
|
52 | - $this->assertEquals( 0, count( $result['included'] ) ); |
|
48 | + $this->assertEquals(2, $result['meta']['total']); |
|
49 | + $this->assertEquals(2, count($result['data'])); |
|
50 | + $this->assertEquals('price', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(0, count($result['data'][0]['relationships'])); |
|
52 | + $this->assertEquals(0, count($result['included'])); |
|
53 | 53 | |
54 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
54 | + $this->assertArrayNotHasKey('errors', $result); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Config\Standard( $this->context, 'coupon/config' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Config\Standard($this->context, 'coupon/config'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | $params = array( |
33 | 33 | 'id' => 'Example,Required,BasketValues', |
34 | 34 | ); |
35 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
36 | - $this->view->addHelper( 'param', $helper ); |
|
35 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
36 | + $this->view->addHelper('param', $helper); |
|
37 | 37 | |
38 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
39 | - $result = json_decode( (string) $response->getBody(), true ); |
|
38 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
39 | + $result = json_decode((string) $response->getBody(), true); |
|
40 | 40 | |
41 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
42 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
41 | + $this->assertEquals(200, $response->getStatusCode()); |
|
42 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
43 | 43 | |
44 | - $this->assertEquals( 2, $result['meta']['total'] ); |
|
45 | - $this->assertInternalType( 'array', $result['data'] ); |
|
46 | - $this->assertEquals( 'basketvalues.total-value-min', $result['data'][0]['id'] ); |
|
47 | - $this->assertEquals( 'basketvalues.total-value-max', $result['data'][1]['id'] ); |
|
44 | + $this->assertEquals(2, $result['meta']['total']); |
|
45 | + $this->assertInternalType('array', $result['data']); |
|
46 | + $this->assertEquals('basketvalues.total-value-min', $result['data'][0]['id']); |
|
47 | + $this->assertEquals('basketvalues.total-value-max', $result['data'][1]['id']); |
|
48 | 48 | |
49 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
49 | + $this->assertArrayNotHasKey('errors', $result); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Standard( $this->context, 'coupon' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Coupon\Standard($this->context, 'coupon'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,27 +31,27 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'coupon.code.code' => '90AB' ) |
|
34 | + '==' => array('coupon.code.code' => '90AB') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'coupon/code' |
37 | 37 | ); |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
39 | - $this->view->addHelper( 'param', $helper ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
39 | + $this->view->addHelper('param', $helper); |
|
40 | 40 | |
41 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
42 | - $result = json_decode( (string) $response->getBody(), true ); |
|
41 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
42 | + $result = json_decode((string) $response->getBody(), true); |
|
43 | 43 | |
44 | 44 | |
45 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
46 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
45 | + $this->assertEquals(200, $response->getStatusCode()); |
|
46 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
47 | 47 | |
48 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
49 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
50 | - $this->assertEquals( 'coupon', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['coupon/code'] ) ); |
|
52 | - $this->assertEquals( 1, count( $result['included'] ) ); |
|
48 | + $this->assertEquals(1, $result['meta']['total']); |
|
49 | + $this->assertEquals(1, count($result['data'])); |
|
50 | + $this->assertEquals('coupon', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(1, count($result['data'][0]['relationships']['coupon/code'])); |
|
52 | + $this->assertEquals(1, count($result['included'])); |
|
53 | 53 | |
54 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
54 | + $this->assertArrayNotHasKey('errors', $result); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,22 +64,22 @@ discard block |
||
64 | 64 | 'sort' => 'coupon.id', |
65 | 65 | 'include' => 'coupon/code' |
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( 5, $result['meta']['total'] ); |
|
78 | - $this->assertEquals( 5, count( $result['data'] ) ); |
|
79 | - $this->assertEquals( 'coupon', $result['data'][0]['type'] ); |
|
80 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
81 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['coupon/code'] ) ); |
|
82 | - $this->assertEquals( 5, count( $result['included'] ) ); |
|
83 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
77 | + $this->assertEquals(5, $result['meta']['total']); |
|
78 | + $this->assertEquals(5, count($result['data'])); |
|
79 | + $this->assertEquals('coupon', $result['data'][0]['type']); |
|
80 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
81 | + $this->assertEquals(1, count($result['data'][0]['relationships']['coupon/code'])); |
|
82 | + $this->assertEquals(5, count($result['included'])); |
|
83 | + $this->assertArrayNotHasKey('errors', $result); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Product\Standard( $this->context, 'product' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Product\Standard($this->context, 'product'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,34 +31,34 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'product.code' => 'CNE' ) |
|
34 | + '==' => array('product.code' => 'CNE') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'text,product,product/property' |
37 | 37 | ); |
38 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
39 | - $this->view->addHelper( 'param', $helper ); |
|
40 | - |
|
41 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
42 | - $result = json_decode( (string) $response->getBody(), true ); |
|
43 | - |
|
44 | - |
|
45 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
46 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
47 | - |
|
48 | - $this->assertEquals( 1, $result['meta']['total'] ); |
|
49 | - $this->assertEquals( 1, count( $result['data'] ) ); |
|
50 | - $this->assertEquals( 'product', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 6, count( $result['data'][0]['relationships']['text'] ) ); |
|
52 | - $this->assertArrayHaskey( 'self', $result['data'][0]['relationships']['text'][0]['data']['links'] ); |
|
53 | - $this->assertEquals( 5, count( $result['data'][0]['relationships']['product'] ) ); |
|
54 | - $this->assertArrayHaskey( 'self', $result['data'][0]['relationships']['product'][0]['data']['links'] ); |
|
55 | - $this->assertEquals( 4, count( $result['data'][0]['relationships']['product/property'] ) ); |
|
56 | - $this->assertEquals( 14, count( $result['included'] ) ); |
|
57 | - $this->assertEquals( 'product/property', $result['included'][0]['type'] ); |
|
58 | - $this->assertArrayHaskey( 'self', $result['included'][0]['links'] ); |
|
59 | - $this->assertArrayHaskey( 'related', $result['included'][0]['links'] ); |
|
60 | - |
|
61 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
38 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
39 | + $this->view->addHelper('param', $helper); |
|
40 | + |
|
41 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
42 | + $result = json_decode((string) $response->getBody(), true); |
|
43 | + |
|
44 | + |
|
45 | + $this->assertEquals(200, $response->getStatusCode()); |
|
46 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
47 | + |
|
48 | + $this->assertEquals(1, $result['meta']['total']); |
|
49 | + $this->assertEquals(1, count($result['data'])); |
|
50 | + $this->assertEquals('product', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(6, count($result['data'][0]['relationships']['text'])); |
|
52 | + $this->assertArrayHaskey('self', $result['data'][0]['relationships']['text'][0]['data']['links']); |
|
53 | + $this->assertEquals(5, count($result['data'][0]['relationships']['product'])); |
|
54 | + $this->assertArrayHaskey('self', $result['data'][0]['relationships']['product'][0]['data']['links']); |
|
55 | + $this->assertEquals(4, count($result['data'][0]['relationships']['product/property'])); |
|
56 | + $this->assertEquals(14, count($result['included'])); |
|
57 | + $this->assertEquals('product/property', $result['included'][0]['type']); |
|
58 | + $this->assertArrayHaskey('self', $result['included'][0]['links']); |
|
59 | + $this->assertArrayHaskey('related', $result['included'][0]['links']); |
|
60 | + |
|
61 | + $this->assertArrayNotHasKey('errors', $result); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
@@ -71,23 +71,23 @@ discard block |
||
71 | 71 | 'sort' => 'product.id', |
72 | 72 | 'include' => 'product,product/property' |
73 | 73 | ); |
74 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
75 | - $this->view->addHelper( 'param', $helper ); |
|
74 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
75 | + $this->view->addHelper('param', $helper); |
|
76 | 76 | |
77 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
78 | - $result = json_decode( (string) $response->getBody(), true ); |
|
77 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
78 | + $result = json_decode((string) $response->getBody(), true); |
|
79 | 79 | |
80 | 80 | |
81 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
82 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
81 | + $this->assertEquals(200, $response->getStatusCode()); |
|
82 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
83 | 83 | |
84 | - $this->assertEquals( 28, $result['meta']['total'] ); |
|
85 | - $this->assertEquals( 25, count( $result['data'] ) ); |
|
86 | - $this->assertEquals( 'product', $result['data'][0]['type'] ); |
|
87 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
88 | - $this->assertEquals( 5, count( $result['data'][0]['relationships']['product'] ) ); |
|
89 | - $this->assertEquals( 21, count( $result['included'] ) ); |
|
84 | + $this->assertEquals(28, $result['meta']['total']); |
|
85 | + $this->assertEquals(25, count($result['data'])); |
|
86 | + $this->assertEquals('product', $result['data'][0]['type']); |
|
87 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
88 | + $this->assertEquals(5, count($result['data'][0]['relationships']['product'])); |
|
89 | + $this->assertEquals(21, count($result['included'])); |
|
90 | 90 | |
91 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
91 | + $this->assertArrayNotHasKey('errors', $result); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | $this->context = \TestHelperJadm::getContext(); |
22 | 22 | $this->view = $this->context->getView(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JsonAdm\Service\Config\Standard( $this->context, 'service/config' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Service\Config\Standard($this->context, 'service/config'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -33,20 +33,20 @@ discard block |
||
33 | 33 | 'id' => 'DirectDebit,Category', |
34 | 34 | 'type' => 'payment', |
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 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
43 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
42 | + $this->assertEquals(200, $response->getStatusCode()); |
|
43 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
44 | 44 | |
45 | - $this->assertEquals( 2, $result['meta']['total'] ); |
|
46 | - $this->assertInternalType( 'array', $result['data'] ); |
|
47 | - $this->assertEquals( 'category.include', $result['data'][0]['id'] ); |
|
48 | - $this->assertEquals( 'category.exclude', $result['data'][1]['id'] ); |
|
45 | + $this->assertEquals(2, $result['meta']['total']); |
|
46 | + $this->assertInternalType('array', $result['data']); |
|
47 | + $this->assertEquals('category.include', $result['data'][0]['id']); |
|
48 | + $this->assertEquals('category.exclude', $result['data'][1]['id']); |
|
49 | 49 | |
50 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
50 | + $this->assertArrayNotHasKey('errors', $result); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |