generate() public method

public generate ( $number )
Ejemplo n.º 1
0
 public function testGenerate()
 {
     $this->client->addResponse('POST', '/coupons/fifteen-off/generate', 'unique_coupons/generate-201.xml');
     $this->client->addResponse('GET', 'https://api.recurly.com/v2/coupons/fifteen-off/unique_coupon_codes?cursor=1234566890&per_page=20', 'unique_coupons/index-200.xml');
     $coupon = new Recurly_Coupon(null, $this->client);
     $coupon->coupon_code = 'fifteen-off';
     $coupons = $coupon->generate(10);
     $this->assertEquals(count($coupons), 10);
 }