-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
class Recurly_PerformanceObligationListTest extends Recurly_TestCase | ||
{ | ||
public function testPerformanceObligationListAll() { | ||
$this->client->addResponse( | ||
'GET', | ||
'/performance_obligations', | ||
'performance_obligations/list-200.xml' | ||
); | ||
|
||
$performance_obligations = Recurly_PerformanceObligationList::get(null, $this->client); | ||
$this->assertInstanceOf('Recurly_PerformanceObligationList', $performance_obligations); | ||
|
||
$performance_obligation = $performance_obligations->current(); | ||
$this->assertInstanceOf('Recurly_PerformanceObligation', $performance_obligation); | ||
|
||
$this->assertEquals(iterator_count($performance_obligations), 3); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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_PerformanceObligation::get('6', $this->client); | ||
|
||
$this->assertInstanceOf('Recurly_PerformanceObligation', $pob); | ||
$this->assertEquals('Over Time (Daily)', $pob->name); | ||
$this->assertEquals('6', $pob->id); | ||
$this->assertInstanceOf('DateTime', $pob->created_at); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
/** | ||
* Class Recurly PerformanceObligation | ||
* @property string $id | ||
* @property string $name The name of the POB. | ||
* @property DateTime $created_at The date and time the gla was created in Recurly. | ||
* @property DateTime $updated_at The date and time the gla was last updated. | ||
*/ | ||
|
||
class Recurly_PerformanceObligation extends Recurly_Resource | ||
{ | ||
/** | ||
* @param string $id | ||
* @param Recurly_Client $client | ||
* @return Recurly_PerformanceObligation | ||
* @throws Recurly_Error | ||
*/ | ||
public static function get($id, $client = null) { | ||
return Recurly_Base::_get(Recurly_PerformanceObligation::uriForPerformanceObligation($id), $client); | ||
} | ||
|
||
protected static function uriForPerformanceObligation($id) { | ||
return self::_safeUri(Recurly_Client::PATH_PERFORMANCE_OBLIGATIONS, $id); | ||
} | ||
|
||
protected function getNodeName() { | ||
return 'performance_obligation'; | ||
} | ||
|
||
protected function getWriteableAttributes() { | ||
return array(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
class Recurly_PerformanceObligationList extends Recurly_Pager | ||
{ | ||
public static function get($params = null, $client = null) { | ||
$uri = self::_uriWithParams(Recurly_Client::PATH_PERFORMANCE_OBLIGATIONS, $params); | ||
return new self($uri, $client); | ||
} | ||
|
||
protected function getNodeName() { | ||
return 'performance_obligations'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters