ListTest.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. require_once('TestAutoLoad.php');
  3. use Culqi\Culqi;
  4. class ListTest extends PHPUnit_Framework_TestCase {
  5. protected $API_KEY;
  6. protected function setUp() {
  7. $this->API_KEY = getenv("API_KEY");
  8. $this->culqi = new Culqi(array("api_key" => $this->API_KEY ));
  9. }
  10. public function testListTokens() {
  11. $tokens = $this->culqi->Tokens->all(array("limit" => 50));
  12. $valid = false;
  13. if(count($tokens->data) >= 0) {
  14. $valid = true;
  15. }
  16. $this->assertTrue($valid);
  17. }
  18. public function testListCharges() {
  19. $charges = $this->culqi->Charges->all(array("min_amount" => 1000, "max_amount" => 1000000, "limit" => 50));
  20. $valid = false;
  21. if(count($charges->data) >= 0) {
  22. $valid = true;
  23. }
  24. $this->assertTrue($valid);
  25. }
  26. public function testListPlans() {
  27. $plans = $this->culqi->Plans->all(array("limit" => 50));
  28. $valid = false;
  29. if(count($plans->data) >= 0) {
  30. $valid = true;
  31. }
  32. $this->assertTrue($valid);
  33. }
  34. public function testListCustomers() {
  35. $customers = $this->culqi->Customers->all(array("limit" => 50));
  36. $valid = false;
  37. if(count($customers->data) >= 0) {
  38. $valid = true;
  39. }
  40. $this->assertTrue($valid);
  41. }
  42. public function testListCards() {
  43. $cards = $this->culqi->Cards->all(array("limit" => 50));
  44. $valid = false;
  45. if(count($cards->data) >= 0) {
  46. $valid = true;
  47. }
  48. $this->assertTrue($valid);
  49. }
  50. public function testListSubscriptions() {
  51. $subscriptions = $this->culqi->Subscriptions->all(array("limit" => 50));
  52. $valid = false;
  53. if(count($subscriptions->data) >= 0) {
  54. $valid = true;
  55. }
  56. $this->assertTrue($valid);
  57. }
  58. public function testListRefunds() {
  59. $refunds = $this->culqi->Refunds->all(array("limit" => 50));
  60. $valid = false;
  61. if(count($refunds->data) >= 0) {
  62. $valid = true;
  63. }
  64. $this->assertTrue($valid);
  65. }
  66. public function testListTransfers() {
  67. $transfers = $this->culqi->Transfers->all(array("limit" => 50));
  68. $valid = false;
  69. if(count($transfers->data) >= 0) {
  70. $valid = true;
  71. }
  72. $this->assertTrue($valid);
  73. }
  74. }