AddOnTest.php 887 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Test\Unit;
  3. require_once dirname(__DIR__) . '/Setup.php';
  4. use Test\Setup;
  5. use Braintree;
  6. class AddOnTest extends Setup
  7. {
  8. public function testFactory()
  9. {
  10. $addOn = Braintree\AddOn::factory([]);
  11. $this->assertInstanceOf('Braintree\AddOn', $addOn);
  12. }
  13. public function testToString()
  14. {
  15. $addOnParams = [
  16. "amount" => "100.00",
  17. "description" => "some description",
  18. "id" => "1",
  19. "kind" => "add_on",
  20. "name" => "php_add_on",
  21. "neverExpires" => "false",
  22. "numberOfBillingCycles" => "1"
  23. ];
  24. $addOn = Braintree\AddOn::factory($addOnParams);
  25. $this->assertEquals("Braintree\AddOn[amount=100.00, description=some description, id=1, kind=add_on, name=php_add_on, neverExpires=false, numberOfBillingCycles=1]", (string) $addOn);
  26. }
  27. }