Пример #1
0
 /**
  * Initializes resources (i.e. registers them with Resource::_registry). Note
  * that if you add a Resource then you must initialize it here.
  * 
  * @internal
  */
 private static function initializeResources()
 {
     if (self::$initialized) {
         return;
     }
     \Balanced\Errors\Error::init();
     \Balanced\Resource::init();
     \Balanced\APIKey::init();
     \Balanced\Marketplace::init();
     \Balanced\Account::init();
     \Balanced\Credit::init();
     \Balanced\Debit::init();
     \Balanced\Refund::init();
     \Balanced\Card::init();
     \Balanced\BankAccount::init();
     \Balanced\Hold::init();
     \Balanced\Merchant::init();
     self::$initialized = true;
 }
Пример #2
0
 function testCapture()
 {
     $collection = $this->getMock('\\RESTful\\Collection', array('create'), array('\\Balanced\\Debit', 'some/uri', null));
     $collection->expects($this->once())->method('create')->with(array('hold_uri' => 'some/hold/uri', 'amount' => 2211));
     $account = new Account(array('debits' => $collection));
     $hold = new Hold(array('uri' => 'some/hold/uri', 'account' => $account));
     $hold->capture(2211);
 }