| @@ 70-91 (lines=22) @@ | ||
| 67 | * |
|
| 68 | * @depends testPostShipping |
|
| 69 | */ |
|
| 70 | public function testGetShippingAddress($param) |
|
| 71 | { |
|
| 72 | $this->client->request( |
|
| 73 | 'GET', |
|
| 74 | $this->getUrl( |
|
| 75 | 'oro_api_get_cart_address_shipping', |
|
| 76 | [ |
|
| 77 | 'cartId' => $param['cartId'] |
|
| 78 | ] |
|
| 79 | ) |
|
| 80 | ); |
|
| 81 | ||
| 82 | $entity = $this->getJsonResponseContent($this->client->getResponse(), 200); |
|
| 83 | ||
| 84 | $this->assertNotEmpty($entity); |
|
| 85 | $this->assertNotEmpty($entity['id']); |
|
| 86 | $this->assertEquals($param['shippingAddressId'], $entity['id']); |
|
| 87 | ||
| 88 | $param['request'] = $entity; |
|
| 89 | ||
| 90 | return $param; |
|
| 91 | } |
|
| 92 | ||
| 93 | /** |
|
| 94 | * @param $param |
|
| @@ 224-245 (lines=22) @@ | ||
| 221 | * |
|
| 222 | * @depends testPostBilling |
|
| 223 | */ |
|
| 224 | public function testGetBillingAddress($param) |
|
| 225 | { |
|
| 226 | $this->client->request( |
|
| 227 | 'GET', |
|
| 228 | $this->getUrl( |
|
| 229 | 'oro_api_get_cart_address_billing', |
|
| 230 | [ |
|
| 231 | 'cartId' => $param['cartId'] |
|
| 232 | ] |
|
| 233 | ) |
|
| 234 | ); |
|
| 235 | ||
| 236 | $entity = $this->getJsonResponseContent($this->client->getResponse(), 200); |
|
| 237 | ||
| 238 | $this->assertNotEmpty($entity); |
|
| 239 | $this->assertNotEmpty($entity['id']); |
|
| 240 | $this->assertEquals($param['billingAddressId'], $entity['id']); |
|
| 241 | ||
| 242 | $param['request'] = $entity; |
|
| 243 | ||
| 244 | return $param; |
|
| 245 | } |
|
| 246 | ||
| 247 | /** |
|
| 248 | * @param $param |
|
| @@ 143-157 (lines=15) @@ | ||
| 140 | /** |
|
| 141 | * @depends testUpdateB2bCustomer |
|
| 142 | */ |
|
| 143 | public function testGetB2bCustomers($request) |
|
| 144 | { |
|
| 145 | $this->client->request( |
|
| 146 | 'GET', |
|
| 147 | $this->getUrl('oro_api_get_b2bcustomers') |
|
| 148 | ); |
|
| 149 | ||
| 150 | $result = $this->getJsonResponseContent($this->client->getResponse(), 200); |
|
| 151 | ||
| 152 | $this->assertNotEmpty($result); |
|
| 153 | ||
| 154 | $result = end($result); |
|
| 155 | $this->assertEquals($request['id'], $result['id']); |
|
| 156 | $this->assertEquals($request['b2bcustomer']['name'], $result['name']); |
|
| 157 | } |
|
| 158 | ||
| 159 | /** |
|
| 160 | * @depends testUpdateB2bCustomer |
|
| @@ 150-164 (lines=15) @@ | ||
| 147 | * |
|
| 148 | * @return string |
|
| 149 | */ |
|
| 150 | public function testInfo($returnValue) |
|
| 151 | { |
|
| 152 | $crawler = $this->client->request( |
|
| 153 | 'GET', |
|
| 154 | $this->getUrl( |
|
| 155 | 'orocrm_sales_lead_info', |
|
| 156 | ['id' => $returnValue['id'], '_widgetContainer' => 'block'] |
|
| 157 | ) |
|
| 158 | ); |
|
| 159 | ||
| 160 | $result = $this->client->getResponse(); |
|
| 161 | $this->assertHtmlResponseStatusCodeEquals($result, 200); |
|
| 162 | $this->assertContains($returnValue['firstName'], $crawler->html()); |
|
| 163 | $this->assertContains($returnValue['lastName'], $crawler->html()); |
|
| 164 | } |
|
| 165 | ||
| 166 | /** |
|
| 167 | * @param array $returnValue |
|