Skip to content

Commit

Permalink
fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
faiberrec committed Feb 19, 2024
1 parent aadbc64 commit c000474
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Tests/Recurly/GiftCard_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public function testGetGiftCard() {
$this->assertEquals($giftCard->product_code,'gift_card');
$this->assertEquals($giftCard->unit_amount_in_cents,'2000');
$this->assertEquals($giftCard->currency,'USD');
$this->assertEquals($giftCard->redeemed_at,'2011-04-25T07:00:00Z');
$this->assertEquals($giftCard->delivered_at,'2011-04-25T07:00:00Z');
$this->assertEquals($giftCard->balance_in_cents,'2000');
$this->assertEquals($giftCard->created_at,'2011-04-25T07:00:00Z');
$this->assertEquals($giftCard->updated_at,'2011-04-25T07:00:00Z');
$this->assertEquals($giftCard->liability_gl_account_id,'t5ejtge1xw0x');
$this->assertEquals($giftCard->revenue_gl_account_id,'t5ejtgf1vxh1');
$this->assertEquals($giftCard->performance_obligation_id,'4');
$this->assertInstanceOf('DateTime', $giftCard->created_at);
$this->assertInstanceOf('DateTime', $giftCard->updated_at);
$this->assertInstanceOf('DateTime', $giftCard->redeemed_at);
$this->assertInstanceOf('DateTime', $giftCard->delivered_at);
}

public function testRedeemGiftCard() {
Expand Down
6 changes: 3 additions & 3 deletions Tests/Recurly/Item_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testReactivate() {
$this->assertEquals('active', $item->state);
$this->assertEquals($item->liability_gl_account_id,'t5ejtge1xw0x');
$this->assertEquals($item->revenue_gl_account_id,'t5ejtgf1vxh1');
$this->assertEquals($item->performance_obligation_id,'4');
$this->assertEquals($item->performance_obligation_id,'5');
}

public function testReactivateItem() {
Expand All @@ -72,7 +72,7 @@ public function testReactivateItem() {
$this->assertEquals('active', $item->state);
$this->assertEquals($item->liability_gl_account_id,'t5ejtge1xw0x');
$this->assertEquals($item->revenue_gl_account_id,'t5ejtgf1vxh1');
$this->assertEquals($item->performance_obligation_id,'4');
$this->assertEquals($item->performance_obligation_id,'5');
}

public function testCreateXml() {
Expand All @@ -83,7 +83,7 @@ public function testCreateXml() {
$item->custom_fields[] = new Recurly_CustomField('size', 'small');
$item->liability_gl_account_id = 't5ejtge1xw0x';
$item->revenue_gl_account_id = 't5ejtgf1vxh1';
$item->performance_obligation_id = '4';
$item->performance_obligation_id = '5';

$this->assertEquals(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<item><item_code>little_llama</item_code><name>Little Llama</name><description>A description about llamas</description><custom_fields><custom_field><name>size</name><value>small</value></custom_field></custom_fields><liability_gl_account_id>t5ejtge1xw0x</liability_gl_account_id><revenue_gl_account_id>t5ejtgf1vxh1</revenue_gl_account_id><performance_obligation_id>5</performance_obligation_id></item>\n",
Expand Down
3 changes: 2 additions & 1 deletion lib/recurly/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ protected function getNodeName() {
protected function getWriteableAttributes() {
return array(
'item_code', 'name', 'description', 'external_sku',
'accounting_code', 'revenue', 'state', 'custom_fields'
'accounting_code', 'revenue', 'state', 'custom_fields',
'liability_gl_account_id', 'revenue_gl_account_id', 'performance_obligation_id'
);
}
}

0 comments on commit c000474

Please sign in to comment.