public function testPassingClientToStub() { $this->client->addResponse('GET', 'abcdef1234567890', 'adjustments/show-200.xml'); $adjustment = Recurly_Base::_get('abcdef1234567890', $this->client); $this->assertInstanceOf('Recurly_Adjustment', $adjustment); $invoice = $adjustment->invoice; $this->assertInstanceOf('Recurly_Stub', $invoice); $this->assertEquals(getProtectedProperty($invoice, '_client'), $this->client); }
public function testFromNested() { $this->client->addResponse('GET', '/a-mock', 'pager/show-200.xml'); $account = Recurly_Base::_get('/a-mock', $this->client); $this->assertInstanceOf('Recurly_Account', $account); $pager = $account->mocks; $this->assertInstanceOf('Mock_Pager', $pager); $this->assertNull($pager->getHref(), "Nested records shouldn't have a URL"); $this->assertEquals(4, $pager->count(), 'Returns correct count'); $this->assertIteratesCorrectly($pager, 4); }
public function testPassingClientToStub() { $this->client->addResponse('GET', 'abcdef1234567890', 'adjustments/show-200.xml'); $adjustment = Recurly_Base::_get('abcdef1234567890', $this->client); $this->assertInstanceOf('Recurly_Adjustment', $adjustment); $this->assertInstanceOf('Recurly_Stub', $adjustment->invoice); // The client is protected so we do a little song and dance to access it: $reflection = new \ReflectionClass($adjustment->invoice); $property = $reflection->getProperty('_client'); $property->setAccessible(true); $this->assertEquals($property->getValue($adjustment->invoice), $this->client); }
public static function fetch($token, $client = null) { $uri = Recurly_Client::PATH_RECURLY_JS_RESULT . '/' . rawurlencode($token); return Recurly_Base::_get($uri, $client); }
public static function get($couponCode, $client = null) { return Recurly_Base::_get(Recurly_Coupon::uriForCoupon($couponCode), $client); }
public static function get($planCode, $client = null) { return Recurly_Base::_get(Recurly_Plan::uriForPlan($planCode), $client); }
public static function get($uuid, $client = null) { return Recurly_Base::_get(Recurly_Subscription::uriForSubscription($uuid), $client); }
public static function get($accountCode, $client = null) { return Recurly_Base::_get(Recurly_BillingInfo::uriForBillingInfo($accountCode), $client); }
/** * Get a gift card by the id */ public static function get($giftCardId, $client = null) { return Recurly_Base::_get(Recurly_GiftCard::uriForGiftCard($giftCardId), $client); }
public static function get($uuid, $client = null) { return Recurly_Base::_get(Recurly_Transaction::uriForTransaction($uuid), $client); }
public static function get($accountCode, $client = null) { return Recurly_Base::_get(Recurly_AccountAcquisition::uriForAccountAcquisition($accountCode), $client); }
public static function get($id, $client = null) { return Recurly_Base::_get(Recurly_MeasuredUnit::uriForMeasuredUnit($id), $client); }
public static function get($accountCode, $client = null) { return Recurly_Base::_get(Recurly_NoteList::uriForNotes($accountCode), $client); }
public static function get($subUuid, $addOnCode, $usageId, $client = null) { return Recurly_Base::_get(self::uriForUsage($subUuid, $addOnCode, $usageId), $client); }
public static function get($accountCode, $client = null) { return Recurly_Base::_get(Recurly_CouponRedemption::uriForAccount($accountCode), $client); }
public static function get($adjustment_uuid) { return Recurly_Base::_get(Recurly_Client::PATH_ADJUSTMENTS . '/' . rawurlencode($adjustment_uuid)); }
public static function get($planCode, $addonCode) { return Recurly_Base::_get(Recurly_Addon::uriForAddOn($planCode, $addonCode)); }
public static function get($accountCode, $client = null) { return Recurly_Base::_get(Recurly_Client::PATH_ACCOUNTS . '/' . rawurlencode($accountCode) . Recurly_Client::PATH_BALANCE, $client); }