@@ -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\Supplier\Standard( $this->context, 'supplier' ); |
|
25 | - $this->object->setAimeos( \TestHelperJadm::getAimeos() ); |
|
26 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JsonAdm\Supplier\Standard($this->context, 'supplier'); |
|
25 | + $this->object->setAimeos(\TestHelperJadm::getAimeos()); |
|
26 | + $this->object->setView($this->view); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
@@ -31,28 +31,28 @@ discard block |
||
31 | 31 | { |
32 | 32 | $params = array( |
33 | 33 | 'filter' => array( |
34 | - '==' => array( 'supplier.code' => 'unitCode001' ) |
|
34 | + '==' => array('supplier.code' => 'unitCode001') |
|
35 | 35 | ), |
36 | 36 | 'include' => 'text,supplier/address' |
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( 'supplier', $result['data'][0]['type'] ); |
|
51 | - $this->assertEquals( 3, count( $result['data'][0]['relationships']['text'] ) ); |
|
52 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['supplier/address'] ) ); |
|
53 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
48 | + $this->assertEquals(1, $result['meta']['total']); |
|
49 | + $this->assertEquals(1, count($result['data'])); |
|
50 | + $this->assertEquals('supplier', $result['data'][0]['type']); |
|
51 | + $this->assertEquals(3, count($result['data'][0]['relationships']['text'])); |
|
52 | + $this->assertEquals(1, count($result['data'][0]['relationships']['supplier/address'])); |
|
53 | + $this->assertEquals(4, count($result['included'])); |
|
54 | 54 | |
55 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
55 | + $this->assertArrayNotHasKey('errors', $result); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $params = array( |
62 | 62 | 'filter' => array( |
63 | - '=~' => array( 'supplier.code' => 'unitCode00' ) |
|
63 | + '=~' => array('supplier.code' => 'unitCode00') |
|
64 | 64 | ), |
65 | 65 | 'fields' => array( |
66 | 66 | 'supplier' => 'supplier.id,supplier.label' |
@@ -68,23 +68,23 @@ discard block |
||
68 | 68 | 'sort' => 'supplier.id', |
69 | 69 | 'include' => 'supplier/address' |
70 | 70 | ); |
71 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
72 | - $this->view->addHelper( 'param', $helper ); |
|
71 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
72 | + $this->view->addHelper('param', $helper); |
|
73 | 73 | |
74 | - $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
75 | - $result = json_decode( (string) $response->getBody(), true ); |
|
74 | + $response = $this->object->get($this->view->request(), $this->view->response()); |
|
75 | + $result = json_decode((string) $response->getBody(), true); |
|
76 | 76 | |
77 | 77 | |
78 | - $this->assertEquals( 200, $response->getStatusCode() ); |
|
79 | - $this->assertEquals( 1, count( $response->getHeader( 'Content-Type' ) ) ); |
|
78 | + $this->assertEquals(200, $response->getStatusCode()); |
|
79 | + $this->assertEquals(1, count($response->getHeader('Content-Type'))); |
|
80 | 80 | |
81 | - $this->assertEquals( 3, $result['meta']['total'] ); |
|
82 | - $this->assertEquals( 3, count( $result['data'] ) ); |
|
83 | - $this->assertEquals( 'supplier', $result['data'][0]['type'] ); |
|
84 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
85 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['supplier/address'] ) ); |
|
86 | - $this->assertEquals( 3, count( $result['included'] ) ); |
|
81 | + $this->assertEquals(3, $result['meta']['total']); |
|
82 | + $this->assertEquals(3, count($result['data'])); |
|
83 | + $this->assertEquals('supplier', $result['data'][0]['type']); |
|
84 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
85 | + $this->assertEquals(1, count($result['data'][0]['relationships']['supplier/address'])); |
|
86 | + $this->assertEquals(3, count($result['included'])); |
|
87 | 87 | |
88 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
88 | + $this->assertArrayNotHasKey('errors', $result); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | \ No newline at end of file |