|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Paylike\Tests; |
| 4 | + |
| 5 | +use Paylike\Endpoint\Merchant\Lines; |
| 6 | + |
| 7 | +class MerchantsLinesTest extends BaseTest |
| 8 | +{ |
| 9 | + /** |
| 10 | + * @var Lines |
| 11 | + */ |
| 12 | + protected $lines; |
| 13 | + |
| 14 | + /** |
| 15 | + * |
| 16 | + */ |
| 17 | + public function setUp() { |
| 18 | + parent::setUp(); |
| 19 | + $this->lines = $this->paylike->merchants()->lines(); |
| 20 | + } |
| 21 | + |
| 22 | + |
| 23 | + /** |
| 24 | + * @throws \Exception |
| 25 | + */ |
| 26 | + public function testGetAllLinesCursor() { |
| 27 | + $merchant_id = $this->merchant_id; |
| 28 | + $api_lines = $this->lines->find($merchant_id); |
| 29 | + $ids = array(); |
| 30 | + foreach ($api_lines as $line) { |
| 31 | + // the lines array grows as needed |
| 32 | + $ids[] = $line['id']; |
| 33 | + } |
| 34 | + |
| 35 | + $this->assertGreaterThan(0, count($ids), 'number of lines'); |
| 36 | + } |
| 37 | + |
| 38 | + /** |
| 39 | + * @throws \Exception |
| 40 | + */ |
| 41 | + public function testGetAllLinesCursorBefore() { |
| 42 | + $merchant_id = $this->merchant_id; |
| 43 | + $before = '5da8594efd0c53603c7bb3a5'; |
| 44 | + $api_lines = $this->lines->before($merchant_id, $before); |
| 45 | + $ids = array(); |
| 46 | + foreach ($api_lines as $line) { |
| 47 | + // the lines array grows as needed |
| 48 | + $ids[] = $line['id']; |
| 49 | + } |
| 50 | + |
| 51 | + $this->assertGreaterThan(0, count($api_lines), 'number of lines'); |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * @throws \Exception |
| 56 | + */ |
| 57 | + public function testGetAllMerchantsCursorAfter() { |
| 58 | + $merchant_id = $this->merchant_id; |
| 59 | + $after = '5da8594efd0c53603c7bb3a5'; |
| 60 | + $api_lines = $this->lines->after($merchant_id, $after); |
| 61 | + $ids = array(); |
| 62 | + foreach ($api_lines as $line) { |
| 63 | + // the lines array grows as needed |
| 64 | + $ids[] = $line['id']; |
| 65 | + } |
| 66 | + |
| 67 | + $this->assertGreaterThan(0, count($api_lines), 'number of lines'); |
| 68 | + } |
| 69 | +} |
0 commit comments