| @@ 377-402 (lines=26) @@ | ||
| 374 | $client->custom('params'); |
|
| 375 | } |
|
| 376 | ||
| 377 | public function testAddingOptionsPassesThroughTheOptionsToGuzzle() |
|
| 378 | { |
|
| 379 | $gigyaResponse = $this->setupCall( |
|
| 380 | 'accounts.getAccountInfo', |
|
| 381 | 'https://accounts.eu1.gigya.com/accounts.getAccountInfo', |
|
| 382 | [ |
|
| 383 | 'auth' => 'gigya', |
|
| 384 | 'verify' => $this->certPath, |
|
| 385 | 'query' => [ |
|
| 386 | 'params' => 'passedThrough', |
|
| 387 | ], |
|
| 388 | 'option1' => 'value1', |
|
| 389 | 'option2' => false, |
|
| 390 | ], |
|
| 391 | 'key', |
|
| 392 | 'secret' |
|
| 393 | ); |
|
| 394 | $client = $this->createClient(); |
|
| 395 | ||
| 396 | $client->addOption('option1', 'value1'); |
|
| 397 | $client->addOption('option2', false); |
|
| 398 | ||
| 399 | $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']); |
|
| 400 | ||
| 401 | static::assertSame($gigyaResponse, $result); |
|
| 402 | } |
|
| 403 | ||
| 404 | public function testAddingOptionsWithASingleCallPassesThroughTheOptionsToGuzzle() |
|
| 405 | { |
|
| @@ 404-431 (lines=28) @@ | ||
| 401 | static::assertSame($gigyaResponse, $result); |
|
| 402 | } |
|
| 403 | ||
| 404 | public function testAddingOptionsWithASingleCallPassesThroughTheOptionsToGuzzle() |
|
| 405 | { |
|
| 406 | $gigyaResponse = $this->setupCall( |
|
| 407 | 'accounts.getAccountInfo', |
|
| 408 | 'https://accounts.eu1.gigya.com/accounts.getAccountInfo', |
|
| 409 | [ |
|
| 410 | 'auth' => 'gigya', |
|
| 411 | 'verify' => $this->certPath, |
|
| 412 | 'query' => [ |
|
| 413 | 'params' => 'passedThrough', |
|
| 414 | ], |
|
| 415 | 'option1' => 'value1', |
|
| 416 | 'option2' => true, |
|
| 417 | ], |
|
| 418 | 'key', |
|
| 419 | 'secret' |
|
| 420 | ); |
|
| 421 | $client = $this->createClient(); |
|
| 422 | ||
| 423 | $client->addOptions([ |
|
| 424 | 'option1' => 'value1', |
|
| 425 | 'option2' => true, |
|
| 426 | ]); |
|
| 427 | ||
| 428 | $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']); |
|
| 429 | ||
| 430 | static::assertSame($gigyaResponse, $result); |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testAddingTheSameOptionAgainWillTakeTheLastValueSet() |
|
| 434 | { |
|
| @@ 433-457 (lines=25) @@ | ||
| 430 | static::assertSame($gigyaResponse, $result); |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testAddingTheSameOptionAgainWillTakeTheLastValueSet() |
|
| 434 | { |
|
| 435 | $gigyaResponse = $this->setupCall( |
|
| 436 | 'accounts.getAccountInfo', |
|
| 437 | 'https://accounts.eu1.gigya.com/accounts.getAccountInfo', |
|
| 438 | [ |
|
| 439 | 'auth' => 'gigya', |
|
| 440 | 'verify' => $this->certPath, |
|
| 441 | 'query' => [ |
|
| 442 | 'params' => 'passedThrough', |
|
| 443 | ], |
|
| 444 | 'option1' => false, |
|
| 445 | ], |
|
| 446 | 'key', |
|
| 447 | 'secret' |
|
| 448 | ); |
|
| 449 | $client = $this->createClient(); |
|
| 450 | ||
| 451 | $client->addOption('option1', 'value1'); |
|
| 452 | $client->addOption('option1', false); |
|
| 453 | ||
| 454 | $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']); |
|
| 455 | ||
| 456 | static::assertSame($gigyaResponse, $result); |
|
| 457 | } |
|
| 458 | ||
| 459 | public function testAddingTheSameOptionAgainWithAddOptionsWillTakeTheLastValueSet() |
|
| 460 | { |
|
| @@ 459-483 (lines=25) @@ | ||
| 456 | static::assertSame($gigyaResponse, $result); |
|
| 457 | } |
|
| 458 | ||
| 459 | public function testAddingTheSameOptionAgainWithAddOptionsWillTakeTheLastValueSet() |
|
| 460 | { |
|
| 461 | $gigyaResponse = $this->setupCall( |
|
| 462 | 'accounts.getAccountInfo', |
|
| 463 | 'https://accounts.eu1.gigya.com/accounts.getAccountInfo', |
|
| 464 | [ |
|
| 465 | 'auth' => 'gigya', |
|
| 466 | 'verify' => $this->certPath, |
|
| 467 | 'query' => [ |
|
| 468 | 'params' => 'passedThrough', |
|
| 469 | ], |
|
| 470 | 'option1' => true, |
|
| 471 | ], |
|
| 472 | 'key', |
|
| 473 | 'secret' |
|
| 474 | ); |
|
| 475 | $client = $this->createClient(); |
|
| 476 | ||
| 477 | $client->addOption('option1', 'value1'); |
|
| 478 | $client->addOptions(['option1' => true]); |
|
| 479 | ||
| 480 | $result = $client->accounts()->getAccountInfo(['params' => 'passedThrough']); |
|
| 481 | ||
| 482 | static::assertSame($gigyaResponse, $result); |
|
| 483 | } |
|
| 484 | ||
| 485 | public function testAddingQueryOptionsWillBeIgnored() |
|
| 486 | { |
|