| @@ 223-251 (lines=29) @@ | ||
| 220 | return $provider; |
|
| 221 | } |
|
| 222 | ||
| 223 | public function testCreate() |
|
| 224 | { |
|
| 225 | $client = $this->newClientExpectingBulk( |
|
| 226 | [ |
|
| 227 | 'body' => |
|
| 228 | [ |
|
| 229 | [ |
|
| 230 | 'create' => [ |
|
| 231 | '_index' => 'my_index', |
|
| 232 | '_type' => 'my_type', |
|
| 233 | '_id' => 'my_id', |
|
| 234 | ] |
|
| 235 | ], |
|
| 236 | [ |
|
| 237 | 'foo' => 'bar', |
|
| 238 | ] |
|
| 239 | ] |
|
| 240 | ] |
|
| 241 | ); |
|
| 242 | ||
| 243 | $provider = $this->newProviderForBulk('create', 'my_id', ['foo' => 'bar']); |
|
| 244 | ||
| 245 | $provider->run( |
|
| 246 | $client, |
|
| 247 | 'my_index', |
|
| 248 | 'my_type', |
|
| 249 | $this->getMock(EventDispatcherInterface::class) |
|
| 250 | ); |
|
| 251 | } |
|
| 252 | ||
| 253 | public function testUpdate() |
|
| 254 | { |
|
| @@ 253-281 (lines=29) @@ | ||
| 250 | ); |
|
| 251 | } |
|
| 252 | ||
| 253 | public function testUpdate() |
|
| 254 | { |
|
| 255 | $client = $this->newClientExpectingBulk( |
|
| 256 | [ |
|
| 257 | 'body' => |
|
| 258 | [ |
|
| 259 | [ |
|
| 260 | 'update' => [ |
|
| 261 | '_index' => 'my_index', |
|
| 262 | '_type' => 'my_type', |
|
| 263 | '_id' => 'my_id', |
|
| 264 | ] |
|
| 265 | ], |
|
| 266 | [ |
|
| 267 | 'foo' => 'bar', |
|
| 268 | ] |
|
| 269 | ] |
|
| 270 | ] |
|
| 271 | ); |
|
| 272 | ||
| 273 | $provider = $this->newProviderForBulk('update', 'my_id', ['foo' => 'bar']); |
|
| 274 | ||
| 275 | $provider->run( |
|
| 276 | $client, |
|
| 277 | 'my_index', |
|
| 278 | 'my_type', |
|
| 279 | $this->getMock(EventDispatcherInterface::class) |
|
| 280 | ); |
|
| 281 | } |
|
| 282 | } |
|
| 283 | ||