public function testFromStub() { $url = '/mocks'; $stub = new Recurly_Stub('mocks', $url, $this->client); $pager = $stub->get(); $this->assertInstanceOf('Mock_Pager', $pager); $this->assertEquals($url, $pager->getHref()); $this->assertEquals($pager->count(), 6, 'Returns correct count'); $this->assertIteratesCorrectly($pager, 6); }
public function testGetParams() { $base_url = 'https://api.recurly.com/v2/accounts/abcdef1234567890/invoices'; $filtered_url = "{$base_url}?state=open"; $this->client->addResponse('GET', $filtered_url, 'invoices/index-200.xml'); $stub = new Recurly_Stub('foo', $base_url, $this->client); $obj = $stub->get(array('state' => 'open')); $this->assertInstanceOf('Recurly_InvoiceList', $obj); $this->assertEquals($filtered_url, $obj->getHref()); }