PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / includes / stripe / libraries / vendor / stripe / stripe-php / tests / TransferTest.php

TransferTest.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.13, at includes/stripe/libraries/vendor/stripe/stripe-php/tests/TransferTest.php

47 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Stripe;
4
5 class TransferTest extends TestCase
6 {
7 // The resource that was traditionally called "transfer" became a "payout"
8 // in API version 2017-04-06. We're testing traditional transfers here, so
9 // we force the API version just prior anywhere that we need to.
10 private $opts = array('stripe_version' => '2017-02-14');
11
12 public function testCreate()
13 {
14 $transfer = self::createTestTransfer(array(), $this->opts);
15 $this->assertSame('transfer', $transfer->object);
16 }
17
18 public function testRetrieve()
19 {
20 $transfer = self::createTestTransfer(array(), $this->opts);
21 $reloaded = Transfer::retrieve($transfer->id, $this->opts);
22 $this->assertSame($reloaded->id, $transfer->id);
23 }
24
25 public function testTransferUpdateMetadata()
26 {
27 $transfer = self::createTestTransfer(array(), $this->opts);
28
29 $transfer->metadata['test'] = 'foo bar';
30 $transfer->save();
31
32 $updatedTransfer = Transfer::retrieve($transfer->id, $this->opts);
33 $this->assertSame('foo bar', $updatedTransfer->metadata['test']);
34 }
35
36 public function testTransferUpdateMetadataAll()
37 {
38 $transfer = self::createTestTransfer(array(), $this->opts);
39
40 $transfer->metadata = array('test' => 'foo bar');
41 $transfer->save();
42
43 $updatedTransfer = Transfer::retrieve($transfer->id, $this->opts);
44 $this->assertSame('foo bar', $updatedTransfer->metadata['test']);
45 }
46 }
47