| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,108 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace Plivo\Tests\Resources; |
|
| 4 |
+ |
|
| 5 |
+ |
|
| 6 |
+ |
|
| 7 |
+ |
|
| 8 |
+use Plivo\Http\PlivoRequest; |
|
| 9 |
+use Plivo\Http\PlivoResponse; |
|
| 10 |
+use Plivo\Tests\BaseTestCase; |
|
| 11 |
+ |
|
| 12 |
+ |
|
| 13 |
+/** |
|
| 14 |
+ * Class MessageTest |
|
| 15 |
+ * @package Plivo\Tests\Resources |
|
| 16 |
+ */ |
|
| 17 |
+class BrandTest extends BaseTestCase {
|
|
| 18 |
+ |
|
| 19 |
+ public function testBrandCreate() |
|
| 20 |
+ {
|
|
| 21 |
+ $request = new PlivoRequest( |
|
| 22 |
+ 'POST', |
|
| 23 |
+ 'Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/', |
|
| 24 |
+ [ |
|
| 25 |
+ 'brand_alias' => "vishnu128", |
|
| 26 |
+ 'profile_uuid' => "3cf3e991-2f94-4910-9712-61442987a2d0", |
|
| 27 |
+ 'brand_type' => "starter", |
|
| 28 |
+ 'secondary_vetting' => false |
|
| 29 |
+ ]); |
|
| 30 |
+ $body = file_get_contents(__DIR__ . '/../Mocks/brandCreationResponse.json'); |
|
| 31 |
+ |
|
| 32 |
+ $this->mock(new PlivoResponse($request,200, $body)); |
|
| 33 |
+ |
|
| 34 |
+ $actual = $this->client->brand->create("vishnu128", "3cf3e991-2f94-4910-9712-61442987a2d0","starter", false);
|
|
| 35 |
+ |
|
| 36 |
+ self::assertNotNull($actual); |
|
| 37 |
+ } |
|
| 38 |
+ |
|
| 39 |
+ public function testGetBrand() |
|
| 40 |
+ {
|
|
| 41 |
+ $brandID = "BRPXS6E"; |
|
| 42 |
+ $request = new PlivoRequest( |
|
| 43 |
+ 'GET', |
|
| 44 |
+ 'Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/'.$brandID.'/', |
|
| 45 |
+ []); |
|
| 46 |
+ $body = file_get_contents(__DIR__ . '/../Mocks/brandGetResponse.json'); |
|
| 47 |
+ |
|
| 48 |
+ $this->mock(new PlivoResponse($request,200, $body)); |
|
| 49 |
+ |
|
| 50 |
+ $actual = $this->client->brand->get($brandID); |
|
| 51 |
+ self::assertNotNull($actual); |
|
| 52 |
+ $this->assertRequest($request); |
|
| 53 |
+ |
|
| 54 |
+ } |
|
| 55 |
+ |
|
| 56 |
+ |
|
| 57 |
+ function testBrandList() |
|
| 58 |
+ {
|
|
| 59 |
+ $request = new PlivoRequest( |
|
| 60 |
+ 'Get', |
|
| 61 |
+ 'Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/', |
|
| 62 |
+ []); |
|
| 63 |
+ $body = file_get_contents(__DIR__ . '/../Mocks/brandListResponse.json'); |
|
| 64 |
+ |
|
| 65 |
+ $this->mock(new PlivoResponse($request,202, $body)); |
|
| 66 |
+ |
|
| 67 |
+ $actual = $this->client->brand->list(); |
|
| 68 |
+ |
|
| 69 |
+ $this->assertRequest($request); |
|
| 70 |
+ |
|
| 71 |
+ self::assertNotNull($actual); |
|
| 72 |
+ } |
|
| 73 |
+ |
|
| 74 |
+ public function testGetBrandUsecase() |
|
| 75 |
+ {
|
|
| 76 |
+ $brandID = "BRPXS6E"; |
|
| 77 |
+ $request = new PlivoRequest( |
|
| 78 |
+ 'GET', |
|
| 79 |
+ 'Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/'.$brandID.'/usecases' . '/', |
|
| 80 |
+ []); |
|
| 81 |
+ $body = file_get_contents(__DIR__ . '/../Mocks/brandGetUsecasesResponse.json'); |
|
| 82 |
+ |
|
| 83 |
+ $this->mock(new PlivoResponse($request,200, $body)); |
|
| 84 |
+ |
|
| 85 |
+ $actual = $this->client->brand->get_brand_usecases($brandID); |
|
| 86 |
+ self::assertNotNull($actual); |
|
| 87 |
+ $this->assertRequest($request); |
|
| 88 |
+ |
|
| 89 |
+ } |
|
| 90 |
+ |
|
| 91 |
+ public function testDeleteBrandUsecase() |
|
| 92 |
+ {
|
|
| 93 |
+ $brandID = "BRPXS6E"; |
|
| 94 |
+ $request = new PlivoRequest( |
|
| 95 |
+ 'DELETE', |
|
| 96 |
+ 'Account/MAXXXXXXXXXXXXXXXXXX/10dlc/Brand/'.$brandID.'/', |
|
| 97 |
+ []); |
|
| 98 |
+ $body = file_get_contents(__DIR__ . '/../Mocks/brandDeleteResponse.json'); |
|
| 99 |
+ |
|
| 100 |
+ $this->mock(new PlivoResponse($request,200, $body)); |
|
| 101 |
+ |
|
| 102 |
+ $actual = $this->client->brand->delete($brandID); |
|
| 103 |
+ self::assertNotNull($actual); |
|
| 104 |
+ $this->assertRequest($request); |
|
| 105 |
+ |
|
| 106 |
+ } |
|
| 107 |
+ |
|
| 108 |
+} |
|
| 0 | 109 |
\ No newline at end of file |