/tests/Model/Generated/Endpoint/MonetaryAccountBankTest.php

https://github.com/bunq/sdk_php · PHP · 66 lines · 38 code · 7 blank · 21 comment · 1 complexity · bf97240ebc2e22308d4bb4cab4ce7eae MD5 · raw file

  1. <?php
  2. namespace bunq\test\Model\Generated\Endpoint;
  3. use bunq\Model\Generated\Endpoint\MonetaryAccountBank;
  4. use bunq\test\BunqSdkTestBase;
  5. use bunq\test\Config;
  6. /**
  7. * Tests:
  8. * MonetaryAccountBank
  9. */
  10. class MonetaryAccountBankTest extends BunqSdkTestBase
  11. {
  12. /**
  13. * Field constants.
  14. */
  15. const STATUS = 'CANCELLED';
  16. const SUB_STATUS = 'REDEMPTION_VOLUNTARY';
  17. const REASON = 'OTHER';
  18. const REASON_DESCRIPTION = 'Because this is a test';
  19. const CURRENCY = 'EUR';
  20. /**
  21. * Prefix for the monetary account description.
  22. */
  23. const PREFIX_MONETARY_ACCOUNT_DESCRIPTION = 'PHPtest_';
  24. /**
  25. * @var int
  26. */
  27. private static $monetaryAccountBankToCloseId;
  28. /**
  29. * Deletes the new created monetary account.
  30. */
  31. public static function tearDownAfterClass(): void
  32. {
  33. if (!is_null(static::$monetaryAccountBankToCloseId)) {
  34. MonetaryAccountBank::update(
  35. static::$monetaryAccountBankToCloseId,
  36. null,
  37. null,
  38. null,
  39. self::STATUS,
  40. self::SUB_STATUS,
  41. self::REASON,
  42. self::REASON_DESCRIPTION
  43. );
  44. }
  45. }
  46. /**
  47. * Test making a new monetary account with an unique description.
  48. *
  49. * This test has no assertion as of its testing to see if the code runs without errors.
  50. */
  51. public function testCreateNewMonetaryAccount()
  52. {
  53. static::$monetaryAccountBankToCloseId = MonetaryAccountBank::create(
  54. self::CURRENCY,
  55. uniqid(self::PREFIX_MONETARY_ACCOUNT_DESCRIPTION)
  56. )->getValue();
  57. static::assertTrue(is_integer(static::$monetaryAccountBankToCloseId));
  58. }
  59. }