@@ -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( 6, $result['meta']['total'] ); |
|
78 | - $this->assertEquals( 6, 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(6, $result['meta']['total']); |
|
78 | + $this->assertEquals(6, 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 |