@@ -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,27 +30,27 @@ 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 | 40 | $header = array(); |
41 | 41 | $status = 500; |
42 | 42 | |
43 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
44 | - |
|
45 | - $this->assertEquals( 200, $status ); |
|
46 | - $this->assertEquals( 1, count( $header ) ); |
|
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 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
43 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
44 | + |
|
45 | + $this->assertEquals(200, $status); |
|
46 | + $this->assertEquals(1, count($header)); |
|
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 | + $this->assertArrayNotHasKey('errors', $result); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $params = array( |
60 | 60 | 'filter' => array( |
61 | - '=~' => array( 'customer.code' => 'UTC' ) |
|
61 | + '=~' => array('customer.code' => 'UTC') |
|
62 | 62 | ), |
63 | 63 | 'fields' => array( |
64 | 64 | 'customer' => 'customer.id,customer.label' |
@@ -66,22 +66,22 @@ discard block |
||
66 | 66 | 'sort' => 'customer.id', |
67 | 67 | 'include' => 'customer/address' |
68 | 68 | ); |
69 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
70 | - $this->view->addHelper( 'param', $helper ); |
|
69 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $params); |
|
70 | + $this->view->addHelper('param', $helper); |
|
71 | 71 | |
72 | 72 | $header = array(); |
73 | 73 | $status = 500; |
74 | 74 | |
75 | - $result = json_decode( $this->object->get( '', $header, $status ), true ); |
|
76 | - |
|
77 | - $this->assertEquals( 200, $status ); |
|
78 | - $this->assertEquals( 1, count( $header ) ); |
|
79 | - $this->assertEquals( 3, $result['meta']['total'] ); |
|
80 | - $this->assertEquals( 3, count( $result['data'] ) ); |
|
81 | - $this->assertEquals( 'customer', $result['data'][0]['type'] ); |
|
82 | - $this->assertEquals( 2, count( $result['data'][0]['attributes'] ) ); |
|
83 | - $this->assertEquals( 1, count( $result['data'][0]['relationships']['customer/address'] ) ); |
|
84 | - $this->assertEquals( 4, count( $result['included'] ) ); |
|
85 | - $this->assertArrayNotHasKey( 'errors', $result ); |
|
75 | + $result = json_decode($this->object->get('', $header, $status), true); |
|
76 | + |
|
77 | + $this->assertEquals(200, $status); |
|
78 | + $this->assertEquals(1, count($header)); |
|
79 | + $this->assertEquals(3, $result['meta']['total']); |
|
80 | + $this->assertEquals(3, count($result['data'])); |
|
81 | + $this->assertEquals('customer', $result['data'][0]['type']); |
|
82 | + $this->assertEquals(2, count($result['data'][0]['attributes'])); |
|
83 | + $this->assertEquals(1, count($result['data'][0]['relationships']['customer/address'])); |
|
84 | + $this->assertEquals(4, count($result['included'])); |
|
85 | + $this->assertArrayNotHasKey('errors', $result); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | \ No newline at end of file |