ClientTokenTest.php 671 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Test\Unit\ClientApi;
  3. require_once dirname(dirname(__DIR__)) . '/Setup.php';
  4. use Test\Setup;
  5. use Braintree;
  6. class ClientTokenTest extends Setup
  7. {
  8. public function testErrorsWhenCreditCardOptionsGivenWithoutCustomerId()
  9. {
  10. $this->setExpectedException('InvalidArgumentException', 'invalid keys: options[makeDefault]');
  11. Braintree\ClientToken::generate(["options" => ["makeDefault" => true]]);
  12. }
  13. public function testErrorsWhenInvalidArgumentIsSupplied()
  14. {
  15. $this->setExpectedException('InvalidArgumentException', 'invalid keys: customrId');
  16. Braintree\ClientToken::generate(["customrId" => "1234"]);
  17. }
  18. }