Skip to content

Commit

Permalink
Add get test
Browse files Browse the repository at this point in the history
  • Loading branch information
faiberrec committed Feb 6, 2024
1 parent 1d59b92 commit d671c39
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Tests/Recurly/PerformanceObligation_Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

class Recurly_PerformanceObligationTest extends Recurly_TestCase
{
function defaultResponses() {
return array(
array('GET', '/performance_obligations/6', 'performance_obligations/show-200.xml'),
);
}

public function testPerformanceObligation() {
$pob = Recurly_GeneralLedgerAccount::get('6', $this->client);

$this->assertInstanceOf('Recurly_PerformanceObligation', $pob);
$this->assertEquals('Over Time (Daily)', $pob->name);
$this->assertEquals('6', $pob->id);
}
}
24 changes: 24 additions & 0 deletions Tests/fixtures/performance_obligations/list-200.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<performance_obligations type="array">
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/6">
<id>6</id>
<name>Over Time (Daily)</name>
<created_at type="datetime">2023-08-11T18:57:57Z</created_at>
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at>
</performance_obligation>
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/5">
<id>5</id>
<name>Over Time (Partial Monthly)</name>
<created_at type="datetime">2023-08-11T18:57:57Z</created_at>
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at>
</performance_obligation>
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/4">
<id>4</id>
<name>Point in Time</name>
<created_at type="datetime">2023-08-11T18:57:57Z</created_at>
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at>
</performance_obligation>
</performance_obligations>
10 changes: 10 additions & 0 deletions Tests/fixtures/performance_obligations/show-200.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<performance_obligation href="https://api.recurly.com/v2/performance_obligations/6">
<id>6</id>
<name>Over Time (Daily)</name>
<created_at type="datetime">2023-08-11T18:57:57Z</created_at>
<updated_at type="datetime">2023-08-11T18:57:57Z</updated_at>
</performance_obligation>

0 comments on commit d671c39

Please sign in to comment.