From c0004744e578a2e9d068a28e120bb819cbbc3b17 Mon Sep 17 00:00:00 2001 From: Faiber Rodriguez Date: Sun, 18 Feb 2024 21:24:32 -0500 Subject: [PATCH] fix specs --- Tests/Recurly/GiftCard_Test.php | 8 ++++---- Tests/Recurly/Item_Test.php | 6 +++--- lib/recurly/item.php | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Tests/Recurly/GiftCard_Test.php b/Tests/Recurly/GiftCard_Test.php index 0214ff89..07378a92 100644 --- a/Tests/Recurly/GiftCard_Test.php +++ b/Tests/Recurly/GiftCard_Test.php @@ -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() { diff --git a/Tests/Recurly/Item_Test.php b/Tests/Recurly/Item_Test.php index b3960e62..079771b7 100644 --- a/Tests/Recurly/Item_Test.php +++ b/Tests/Recurly/Item_Test.php @@ -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() { @@ -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() { @@ -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( "\nlittle_llamaLittle LlamaA description about llamassizesmallt5ejtge1xw0xt5ejtgf1vxh15\n", diff --git a/lib/recurly/item.php b/lib/recurly/item.php index 1dcc7c7f..1d324e7a 100644 --- a/lib/recurly/item.php +++ b/lib/recurly/item.php @@ -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' ); } }