@@ -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->assertGreaterThan( 1, $result['meta']['total'] ); |
|
| 49 | - $this->assertGreaterThan( 1, 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->assertGreaterThan(1, $result['meta']['total']); |
|
| 49 | + $this->assertGreaterThan(1, 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\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,33 +31,33 @@ 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 | - $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( 7, 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( 15, 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 ); |
|
| 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 | + $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(7, 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(15, 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 |