@@ 102-120 (lines=19) @@ | ||
99 | } |
|
100 | ||
101 | ||
102 | public function testGetItemsCriteria() |
|
103 | { |
|
104 | $params = array( |
|
105 | 'filter' => array( |
|
106 | '==' => array( 'attribute.type.code' => 'size' ), |
|
107 | ), |
|
108 | 'sort' => 'attribute.position', |
|
109 | ); |
|
110 | $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
111 | $this->view->addHelper( 'param', $helper ); |
|
112 | ||
113 | $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
114 | $result = json_decode( (string) $response->getBody(), true ); |
|
115 | ||
116 | ||
117 | $this->assertEquals( 200, $response->getStatusCode() ); |
|
118 | $this->assertEquals( 6, $result['meta']['total'] ); |
|
119 | $this->assertArrayNotHasKey( 'errors', $result ); |
|
120 | } |
|
121 | ||
122 | ||
123 | public function testGetMShopException() |
@@ 100-118 (lines=19) @@ | ||
97 | } |
|
98 | ||
99 | ||
100 | public function testGetItemsCriteria() |
|
101 | { |
|
102 | $params = array( |
|
103 | 'filter' => array( |
|
104 | '>=' => array( 'locale.position' => 0 ), |
|
105 | ), |
|
106 | 'sort' => '-locale.position', |
|
107 | ); |
|
108 | $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $params ); |
|
109 | $this->view->addHelper( 'param', $helper ); |
|
110 | ||
111 | $response = $this->object->get( $this->view->request(), $this->view->response() ); |
|
112 | $result = json_decode( (string) $response->getBody(), true ); |
|
113 | ||
114 | ||
115 | $this->assertEquals( 200, $response->getStatusCode() ); |
|
116 | $this->assertEquals( 1, $result['meta']['total'] ); |
|
117 | $this->assertArrayNotHasKey( 'errors', $result ); |
|
118 | } |
|
119 | ||
120 | ||
121 | public function testGetMShopException() |