Skip to content

Commit

Permalink
Merge pull request #741 from recurly/cf_on_invoices
Browse files Browse the repository at this point in the history
Add specs for CF on adjustments in invoices
  • Loading branch information
douglaslise authored Jan 27, 2023
2 parents 876113a + 8c20dde commit df86195
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/Recurly/Invoice_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,14 @@ public function testUpdateInvoice() {
);
$invoice->update();
}

public function testGetInvoiceWithCustomFields() {
$invoice = Recurly_Invoice::get('1001', $this->client);
$this->client->addResponse('GET', 'https://api.recurly.com/v2/invoices/1001', 'invoices/show-200-updated-invoice.xml');
$line_items = $invoice->line_items;

foreach($line_items as $line_item) {
$this->assertEquals(sizeof($line_item->custom_fields), 1);
}
}
}
6 changes: 6 additions & 0 deletions Tests/fixtures/invoices/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Content-Type: application/xml; charset=utf-8
<start_date type="datetime">2012-05-28T17:44:13Z</start_date>
<end_date type="datetime">2013-05-28T17:44:13Z</end_date>
<created_at type="datetime">2012-05-28T17:44:13Z</created_at>
<custom_fields type="array">
<custom_field>
<name>size</name>
<value>small</value>
</custom_field>
</custom_fields>
</adjustment>
</line_items>
<transactions type="array">
Expand Down

0 comments on commit df86195

Please sign in to comment.