@@ -28,17 +28,17 @@ |
||
| 28 | 28 | class BsdTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testGetBSDs() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('get') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/bsds') |
|
| 39 | - ); |
|
| 40 | - $bitlink = new Bsd($mock); |
|
| 41 | - $bitlink->getBSDs(); |
|
| 42 | - } |
|
| 31 | + public function testGetBSDs() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('get') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/bsds') |
|
| 39 | + ); |
|
| 40 | + $bitlink = new Bsd($mock); |
|
| 41 | + $bitlink->getBSDs(); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -28,114 +28,114 @@ |
||
| 28 | 28 | class CampaignTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testCreateChannel() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('post') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/channels'), |
|
| 39 | - $this->identicalTo(['key' => 'value']) |
|
| 40 | - ); |
|
| 41 | - $bitlink = new Campaign($mock); |
|
| 42 | - $bitlink->createChannel(['key' => 'value']); |
|
| 43 | - } |
|
| 31 | + public function testCreateChannel() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('post') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/channels'), |
|
| 39 | + $this->identicalTo(['key' => 'value']) |
|
| 40 | + ); |
|
| 41 | + $bitlink = new Campaign($mock); |
|
| 42 | + $bitlink->createChannel(['key' => 'value']); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function testGetChannels() |
|
| 46 | - { |
|
| 47 | - $mock = $this->createMock(ApiInterface::class); |
|
| 48 | - $mock |
|
| 49 | - ->expects($this->once()) |
|
| 50 | - ->method('get') |
|
| 51 | - ->with( |
|
| 52 | - $this->equalTo('https://api-ssl.bitly.com/v4/channels'), |
|
| 53 | - $this->identicalTo(['key' => 'value']) |
|
| 54 | - ); |
|
| 55 | - $bitlink = new Campaign($mock); |
|
| 56 | - $bitlink->getChannels(['key' => 'value']); |
|
| 57 | - } |
|
| 45 | + public function testGetChannels() |
|
| 46 | + { |
|
| 47 | + $mock = $this->createMock(ApiInterface::class); |
|
| 48 | + $mock |
|
| 49 | + ->expects($this->once()) |
|
| 50 | + ->method('get') |
|
| 51 | + ->with( |
|
| 52 | + $this->equalTo('https://api-ssl.bitly.com/v4/channels'), |
|
| 53 | + $this->identicalTo(['key' => 'value']) |
|
| 54 | + ); |
|
| 55 | + $bitlink = new Campaign($mock); |
|
| 56 | + $bitlink->getChannels(['key' => 'value']); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - public function testCreateCampaign() |
|
| 60 | - { |
|
| 61 | - $mock = $this->createMock(ApiInterface::class); |
|
| 62 | - $mock |
|
| 63 | - ->expects($this->once()) |
|
| 64 | - ->method('post') |
|
| 65 | - ->with( |
|
| 66 | - $this->equalTo('https://api-ssl.bitly.com/v4/campaigns'), |
|
| 67 | - $this->identicalTo(['key' => 'value']) |
|
| 68 | - ); |
|
| 69 | - $bitlink = new Campaign($mock); |
|
| 70 | - $bitlink->createCampaign(['key' => 'value']); |
|
| 71 | - } |
|
| 59 | + public function testCreateCampaign() |
|
| 60 | + { |
|
| 61 | + $mock = $this->createMock(ApiInterface::class); |
|
| 62 | + $mock |
|
| 63 | + ->expects($this->once()) |
|
| 64 | + ->method('post') |
|
| 65 | + ->with( |
|
| 66 | + $this->equalTo('https://api-ssl.bitly.com/v4/campaigns'), |
|
| 67 | + $this->identicalTo(['key' => 'value']) |
|
| 68 | + ); |
|
| 69 | + $bitlink = new Campaign($mock); |
|
| 70 | + $bitlink->createCampaign(['key' => 'value']); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - public function testGetCampaigns() |
|
| 74 | - { |
|
| 75 | - $mock = $this->createMock(ApiInterface::class); |
|
| 76 | - $mock |
|
| 77 | - ->expects($this->once()) |
|
| 78 | - ->method('get') |
|
| 79 | - ->with( |
|
| 80 | - $this->equalTo('https://api-ssl.bitly.com/v4/campaigns'), |
|
| 81 | - $this->identicalTo(['key' => 'value']) |
|
| 82 | - ); |
|
| 83 | - $bitlink = new Campaign($mock); |
|
| 84 | - $bitlink->getCampaigns(['key' => 'value']); |
|
| 85 | - } |
|
| 73 | + public function testGetCampaigns() |
|
| 74 | + { |
|
| 75 | + $mock = $this->createMock(ApiInterface::class); |
|
| 76 | + $mock |
|
| 77 | + ->expects($this->once()) |
|
| 78 | + ->method('get') |
|
| 79 | + ->with( |
|
| 80 | + $this->equalTo('https://api-ssl.bitly.com/v4/campaigns'), |
|
| 81 | + $this->identicalTo(['key' => 'value']) |
|
| 82 | + ); |
|
| 83 | + $bitlink = new Campaign($mock); |
|
| 84 | + $bitlink->getCampaigns(['key' => 'value']); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - public function testGetCampaign() |
|
| 88 | - { |
|
| 89 | - $mock = $this->createMock(ApiInterface::class); |
|
| 90 | - $mock |
|
| 91 | - ->expects($this->once()) |
|
| 92 | - ->method('get') |
|
| 93 | - ->with( |
|
| 94 | - $this->equalTo('https://api-ssl.bitly.com/v4/campaigns/test') |
|
| 95 | - ); |
|
| 96 | - $bitlink = new Campaign($mock); |
|
| 97 | - $bitlink->getCampaign('test'); |
|
| 98 | - } |
|
| 87 | + public function testGetCampaign() |
|
| 88 | + { |
|
| 89 | + $mock = $this->createMock(ApiInterface::class); |
|
| 90 | + $mock |
|
| 91 | + ->expects($this->once()) |
|
| 92 | + ->method('get') |
|
| 93 | + ->with( |
|
| 94 | + $this->equalTo('https://api-ssl.bitly.com/v4/campaigns/test') |
|
| 95 | + ); |
|
| 96 | + $bitlink = new Campaign($mock); |
|
| 97 | + $bitlink->getCampaign('test'); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - public function testUpdateCampaign() |
|
| 101 | - { |
|
| 102 | - $mock = $this->createMock(ApiInterface::class); |
|
| 103 | - $mock |
|
| 104 | - ->expects($this->once()) |
|
| 105 | - ->method('patch') |
|
| 106 | - ->with( |
|
| 107 | - $this->equalTo('https://api-ssl.bitly.com/v4/campaigns/test'), |
|
| 108 | - $this->identicalTo(['key' => 'value']) |
|
| 109 | - ); |
|
| 110 | - $bitlink = new Campaign($mock); |
|
| 111 | - $bitlink->updateCampaign('test', ['key' => 'value']); |
|
| 112 | - } |
|
| 100 | + public function testUpdateCampaign() |
|
| 101 | + { |
|
| 102 | + $mock = $this->createMock(ApiInterface::class); |
|
| 103 | + $mock |
|
| 104 | + ->expects($this->once()) |
|
| 105 | + ->method('patch') |
|
| 106 | + ->with( |
|
| 107 | + $this->equalTo('https://api-ssl.bitly.com/v4/campaigns/test'), |
|
| 108 | + $this->identicalTo(['key' => 'value']) |
|
| 109 | + ); |
|
| 110 | + $bitlink = new Campaign($mock); |
|
| 111 | + $bitlink->updateCampaign('test', ['key' => 'value']); |
|
| 112 | + } |
|
| 113 | 113 | |
| 114 | - public function testGetChannel() |
|
| 115 | - { |
|
| 116 | - $mock = $this->createMock(ApiInterface::class); |
|
| 117 | - $mock |
|
| 118 | - ->expects($this->once()) |
|
| 119 | - ->method('get') |
|
| 120 | - ->with( |
|
| 121 | - $this->equalTo('https://api-ssl.bitly.com/v4/channels/test') |
|
| 122 | - ); |
|
| 123 | - $bitlink = new Campaign($mock); |
|
| 124 | - $bitlink->getChannel('test'); |
|
| 125 | - } |
|
| 114 | + public function testGetChannel() |
|
| 115 | + { |
|
| 116 | + $mock = $this->createMock(ApiInterface::class); |
|
| 117 | + $mock |
|
| 118 | + ->expects($this->once()) |
|
| 119 | + ->method('get') |
|
| 120 | + ->with( |
|
| 121 | + $this->equalTo('https://api-ssl.bitly.com/v4/channels/test') |
|
| 122 | + ); |
|
| 123 | + $bitlink = new Campaign($mock); |
|
| 124 | + $bitlink->getChannel('test'); |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - public function testUpdateChannel() |
|
| 128 | - { |
|
| 129 | - $mock = $this->createMock(ApiInterface::class); |
|
| 130 | - $mock |
|
| 131 | - ->expects($this->once()) |
|
| 132 | - ->method('patch') |
|
| 133 | - ->with( |
|
| 134 | - $this->equalTo('https://api-ssl.bitly.com/v4/channels/test'), |
|
| 135 | - $this->identicalTo(['key' => 'value']) |
|
| 136 | - ); |
|
| 137 | - $bitlink = new Campaign($mock); |
|
| 138 | - $bitlink->updateChannel('test', ['key' => 'value']); |
|
| 139 | - } |
|
| 127 | + public function testUpdateChannel() |
|
| 128 | + { |
|
| 129 | + $mock = $this->createMock(ApiInterface::class); |
|
| 130 | + $mock |
|
| 131 | + ->expects($this->once()) |
|
| 132 | + ->method('patch') |
|
| 133 | + ->with( |
|
| 134 | + $this->equalTo('https://api-ssl.bitly.com/v4/channels/test'), |
|
| 135 | + $this->identicalTo(['key' => 'value']) |
|
| 136 | + ); |
|
| 137 | + $bitlink = new Campaign($mock); |
|
| 138 | + $bitlink->updateChannel('test', ['key' => 'value']); |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | 141 | } |
@@ -28,43 +28,43 @@ |
||
| 28 | 28 | class OrganizationTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testGetOrganizations() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('get') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/organizations') |
|
| 39 | - ); |
|
| 40 | - $bitlink = new Organization($mock); |
|
| 41 | - $bitlink->getOrganizations('test'); |
|
| 42 | - } |
|
| 31 | + public function testGetOrganizations() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('get') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/organizations') |
|
| 39 | + ); |
|
| 40 | + $bitlink = new Organization($mock); |
|
| 41 | + $bitlink->getOrganizations('test'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function testGetOrganizationShortenCounts() |
|
| 45 | - { |
|
| 46 | - $mock = $this->createMock(ApiInterface::class); |
|
| 47 | - $mock |
|
| 48 | - ->expects($this->once()) |
|
| 49 | - ->method('get') |
|
| 50 | - ->with( |
|
| 51 | - $this->equalTo('https://api-ssl.bitly.com/v4/organizations/test/shorten_counts') |
|
| 52 | - ); |
|
| 53 | - $bitlink = new Organization($mock); |
|
| 54 | - $bitlink->getOrganizationShortenCounts('test'); |
|
| 55 | - } |
|
| 44 | + public function testGetOrganizationShortenCounts() |
|
| 45 | + { |
|
| 46 | + $mock = $this->createMock(ApiInterface::class); |
|
| 47 | + $mock |
|
| 48 | + ->expects($this->once()) |
|
| 49 | + ->method('get') |
|
| 50 | + ->with( |
|
| 51 | + $this->equalTo('https://api-ssl.bitly.com/v4/organizations/test/shorten_counts') |
|
| 52 | + ); |
|
| 53 | + $bitlink = new Organization($mock); |
|
| 54 | + $bitlink->getOrganizationShortenCounts('test'); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function testGetOrganization() |
|
| 58 | - { |
|
| 59 | - $mock = $this->createMock(ApiInterface::class); |
|
| 60 | - $mock |
|
| 61 | - ->expects($this->once()) |
|
| 62 | - ->method('get') |
|
| 63 | - ->with( |
|
| 64 | - $this->equalTo('https://api-ssl.bitly.com/v4/organizations/test') |
|
| 65 | - ); |
|
| 66 | - $bitlink = new Organization($mock); |
|
| 67 | - $bitlink->getOrganization('test'); |
|
| 68 | - } |
|
| 57 | + public function testGetOrganization() |
|
| 58 | + { |
|
| 59 | + $mock = $this->createMock(ApiInterface::class); |
|
| 60 | + $mock |
|
| 61 | + ->expects($this->once()) |
|
| 62 | + ->method('get') |
|
| 63 | + ->with( |
|
| 64 | + $this->equalTo('https://api-ssl.bitly.com/v4/organizations/test') |
|
| 65 | + ); |
|
| 66 | + $bitlink = new Organization($mock); |
|
| 67 | + $bitlink->getOrganization('test'); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | } |
@@ -28,17 +28,17 @@ |
||
| 28 | 28 | class AppTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testGetOAuthApp() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('get') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/apps/test') |
|
| 39 | - ); |
|
| 40 | - $bitlink = new App($mock); |
|
| 41 | - $bitlink->getOAuthApp('test'); |
|
| 42 | - } |
|
| 31 | + public function testGetOAuthApp() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('get') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/apps/test') |
|
| 39 | + ); |
|
| 40 | + $bitlink = new App($mock); |
|
| 41 | + $bitlink->getOAuthApp('test'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | } |
@@ -28,58 +28,58 @@ |
||
| 28 | 28 | class CustomTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testUpdateCustomBitlink() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('patch') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test'), |
|
| 39 | - $this->identicalTo(['key' => 'value']) |
|
| 40 | - ); |
|
| 41 | - $bitlink = new Custom($mock); |
|
| 42 | - $bitlink->updateCustomBitlink('test', ['key' => 'value']); |
|
| 43 | - } |
|
| 31 | + public function testUpdateCustomBitlink() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('patch') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test'), |
|
| 39 | + $this->identicalTo(['key' => 'value']) |
|
| 40 | + ); |
|
| 41 | + $bitlink = new Custom($mock); |
|
| 42 | + $bitlink->updateCustomBitlink('test', ['key' => 'value']); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function testGetCustomBitlink() |
|
| 46 | - { |
|
| 47 | - $mock = $this->createMock(ApiInterface::class); |
|
| 48 | - $mock |
|
| 49 | - ->expects($this->once()) |
|
| 50 | - ->method('get') |
|
| 51 | - ->with( |
|
| 52 | - $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test') |
|
| 53 | - ); |
|
| 54 | - $bitlink = new Custom($mock); |
|
| 55 | - $bitlink->getCustomBitlink('test'); |
|
| 56 | - } |
|
| 45 | + public function testGetCustomBitlink() |
|
| 46 | + { |
|
| 47 | + $mock = $this->createMock(ApiInterface::class); |
|
| 48 | + $mock |
|
| 49 | + ->expects($this->once()) |
|
| 50 | + ->method('get') |
|
| 51 | + ->with( |
|
| 52 | + $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test') |
|
| 53 | + ); |
|
| 54 | + $bitlink = new Custom($mock); |
|
| 55 | + $bitlink->getCustomBitlink('test'); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public function testAddCustomBitlink() |
|
| 59 | - { |
|
| 60 | - $mock = $this->createMock(ApiInterface::class); |
|
| 61 | - $mock |
|
| 62 | - ->expects($this->once()) |
|
| 63 | - ->method('post') |
|
| 64 | - ->with( |
|
| 65 | - $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks'), |
|
| 66 | - $this->identicalTo(['key' => 'value']) |
|
| 67 | - ); |
|
| 68 | - $bitlink = new Custom($mock); |
|
| 69 | - $bitlink->addCustomBitlink(['key' => 'value']); |
|
| 70 | - } |
|
| 58 | + public function testAddCustomBitlink() |
|
| 59 | + { |
|
| 60 | + $mock = $this->createMock(ApiInterface::class); |
|
| 61 | + $mock |
|
| 62 | + ->expects($this->once()) |
|
| 63 | + ->method('post') |
|
| 64 | + ->with( |
|
| 65 | + $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks'), |
|
| 66 | + $this->identicalTo(['key' => 'value']) |
|
| 67 | + ); |
|
| 68 | + $bitlink = new Custom($mock); |
|
| 69 | + $bitlink->addCustomBitlink(['key' => 'value']); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - public function testGetCustomBitlinkMetricsByDestination() |
|
| 73 | - { |
|
| 74 | - $mock = $this->createMock(ApiInterface::class); |
|
| 75 | - $mock |
|
| 76 | - ->expects($this->once()) |
|
| 77 | - ->method('get') |
|
| 78 | - ->with( |
|
| 79 | - $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test/clicks_by_destination') |
|
| 80 | - ); |
|
| 81 | - $bitlink = new Custom($mock); |
|
| 82 | - $bitlink->getCustomBitlinkMetricsByDestination('test'); |
|
| 83 | - } |
|
| 72 | + public function testGetCustomBitlinkMetricsByDestination() |
|
| 73 | + { |
|
| 74 | + $mock = $this->createMock(ApiInterface::class); |
|
| 75 | + $mock |
|
| 76 | + ->expects($this->once()) |
|
| 77 | + ->method('get') |
|
| 78 | + ->with( |
|
| 79 | + $this->equalTo('https://api-ssl.bitly.com/v4/custom_bitlinks/test/clicks_by_destination') |
|
| 80 | + ); |
|
| 81 | + $bitlink = new Custom($mock); |
|
| 82 | + $bitlink->getCustomBitlinkMetricsByDestination('test'); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | 85 | } |
@@ -28,31 +28,31 @@ |
||
| 28 | 28 | class UserTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testUpdateUser() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('patch') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/user'), |
|
| 39 | - $this->identicalTo(['key' => 'value']) |
|
| 40 | - ); |
|
| 41 | - $bitlink = new User($mock); |
|
| 42 | - $bitlink->updateUser(['key' => 'value']); |
|
| 43 | - } |
|
| 31 | + public function testUpdateUser() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('patch') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/user'), |
|
| 39 | + $this->identicalTo(['key' => 'value']) |
|
| 40 | + ); |
|
| 41 | + $bitlink = new User($mock); |
|
| 42 | + $bitlink->updateUser(['key' => 'value']); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function testGetUser() |
|
| 46 | - { |
|
| 47 | - $mock = $this->createMock(ApiInterface::class); |
|
| 48 | - $mock |
|
| 49 | - ->expects($this->once()) |
|
| 50 | - ->method('get') |
|
| 51 | - ->with( |
|
| 52 | - $this->equalTo('https://api-ssl.bitly.com/v4/user') |
|
| 53 | - ); |
|
| 54 | - $bitlink = new User($mock); |
|
| 55 | - $bitlink->getUser(); |
|
| 56 | - } |
|
| 45 | + public function testGetUser() |
|
| 46 | + { |
|
| 47 | + $mock = $this->createMock(ApiInterface::class); |
|
| 48 | + $mock |
|
| 49 | + ->expects($this->once()) |
|
| 50 | + ->method('get') |
|
| 51 | + ->with( |
|
| 52 | + $this->equalTo('https://api-ssl.bitly.com/v4/user') |
|
| 53 | + ); |
|
| 54 | + $bitlink = new User($mock); |
|
| 55 | + $bitlink->getUser(); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | 58 | } |
@@ -28,155 +28,155 @@ |
||
| 28 | 28 | class BitlinkTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testGetMetricsForBitlinkByReferrersByDomains() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('get') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referrers_by_domains'), |
|
| 39 | - $this->identicalTo(['key' => 'value']) |
|
| 40 | - ); |
|
| 41 | - $bitlink = new Bitlink($mock); |
|
| 42 | - $bitlink->getMetricsForBitlinkByReferrersByDomains('test', ['key' => 'value']); |
|
| 43 | - } |
|
| 31 | + public function testGetMetricsForBitlinkByReferrersByDomains() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('get') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referrers_by_domains'), |
|
| 39 | + $this->identicalTo(['key' => 'value']) |
|
| 40 | + ); |
|
| 41 | + $bitlink = new Bitlink($mock); |
|
| 42 | + $bitlink->getMetricsForBitlinkByReferrersByDomains('test', ['key' => 'value']); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function testGetMetricsForBitlinkByCountries() |
|
| 46 | - { |
|
| 47 | - $mock = $this->createMock(ApiInterface::class); |
|
| 48 | - $mock |
|
| 49 | - ->expects($this->once()) |
|
| 50 | - ->method('get') |
|
| 51 | - ->with( |
|
| 52 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/countries'), |
|
| 53 | - $this->identicalTo(['key' => 'value']) |
|
| 54 | - ); |
|
| 55 | - $bitlink = new Bitlink($mock); |
|
| 56 | - $bitlink->getMetricsForBitlinkByCountries('test', ['key' => 'value']); |
|
| 57 | - } |
|
| 45 | + public function testGetMetricsForBitlinkByCountries() |
|
| 46 | + { |
|
| 47 | + $mock = $this->createMock(ApiInterface::class); |
|
| 48 | + $mock |
|
| 49 | + ->expects($this->once()) |
|
| 50 | + ->method('get') |
|
| 51 | + ->with( |
|
| 52 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/countries'), |
|
| 53 | + $this->identicalTo(['key' => 'value']) |
|
| 54 | + ); |
|
| 55 | + $bitlink = new Bitlink($mock); |
|
| 56 | + $bitlink->getMetricsForBitlinkByCountries('test', ['key' => 'value']); |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - public function testGetClicksForBitlink() |
|
| 60 | - { |
|
| 61 | - $mock = $this->createMock(ApiInterface::class); |
|
| 62 | - $mock |
|
| 63 | - ->expects($this->once()) |
|
| 64 | - ->method('get') |
|
| 65 | - ->with( |
|
| 66 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/clicks'), |
|
| 67 | - $this->identicalTo(['key' => 'value']) |
|
| 68 | - ); |
|
| 69 | - $bitlink = new Bitlink($mock); |
|
| 70 | - $bitlink->getClicksForBitlink('test', ['key' => 'value']); |
|
| 71 | - } |
|
| 59 | + public function testGetClicksForBitlink() |
|
| 60 | + { |
|
| 61 | + $mock = $this->createMock(ApiInterface::class); |
|
| 62 | + $mock |
|
| 63 | + ->expects($this->once()) |
|
| 64 | + ->method('get') |
|
| 65 | + ->with( |
|
| 66 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/clicks'), |
|
| 67 | + $this->identicalTo(['key' => 'value']) |
|
| 68 | + ); |
|
| 69 | + $bitlink = new Bitlink($mock); |
|
| 70 | + $bitlink->getClicksForBitlink('test', ['key' => 'value']); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - public function testExpandBitlink() |
|
| 74 | - { |
|
| 75 | - $mock = $this->createMock(ApiInterface::class); |
|
| 76 | - $mock |
|
| 77 | - ->expects($this->once()) |
|
| 78 | - ->method('post') |
|
| 79 | - ->with( |
|
| 80 | - $this->equalTo('https://api-ssl.bitly.com/v4/expand'), |
|
| 81 | - $this->identicalTo(['key' => 'value']) |
|
| 82 | - ); |
|
| 83 | - $bitlink = new Bitlink($mock); |
|
| 84 | - $bitlink->expandBitlink(['key' => 'value']); |
|
| 85 | - } |
|
| 73 | + public function testExpandBitlink() |
|
| 74 | + { |
|
| 75 | + $mock = $this->createMock(ApiInterface::class); |
|
| 76 | + $mock |
|
| 77 | + ->expects($this->once()) |
|
| 78 | + ->method('post') |
|
| 79 | + ->with( |
|
| 80 | + $this->equalTo('https://api-ssl.bitly.com/v4/expand'), |
|
| 81 | + $this->identicalTo(['key' => 'value']) |
|
| 82 | + ); |
|
| 83 | + $bitlink = new Bitlink($mock); |
|
| 84 | + $bitlink->expandBitlink(['key' => 'value']); |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | - public function testGetMetricsForBitlinkByReferrers() |
|
| 88 | - { |
|
| 89 | - $mock = $this->createMock(ApiInterface::class); |
|
| 90 | - $mock |
|
| 91 | - ->expects($this->once()) |
|
| 92 | - ->method('get') |
|
| 93 | - ->with( |
|
| 94 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referrers'), |
|
| 95 | - $this->identicalTo(['key' => 'value']) |
|
| 96 | - ); |
|
| 97 | - $bitlink = new Bitlink($mock); |
|
| 98 | - $bitlink->getMetricsForBitlinkByReferrers('test', ['key' => 'value']); |
|
| 99 | - } |
|
| 87 | + public function testGetMetricsForBitlinkByReferrers() |
|
| 88 | + { |
|
| 89 | + $mock = $this->createMock(ApiInterface::class); |
|
| 90 | + $mock |
|
| 91 | + ->expects($this->once()) |
|
| 92 | + ->method('get') |
|
| 93 | + ->with( |
|
| 94 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referrers'), |
|
| 95 | + $this->identicalTo(['key' => 'value']) |
|
| 96 | + ); |
|
| 97 | + $bitlink = new Bitlink($mock); |
|
| 98 | + $bitlink->getMetricsForBitlinkByReferrers('test', ['key' => 'value']); |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - public function testCreateFullBitlink() |
|
| 102 | - { |
|
| 103 | - $mock = $this->createMock(ApiInterface::class); |
|
| 104 | - $mock |
|
| 105 | - ->expects($this->once()) |
|
| 106 | - ->method('post') |
|
| 107 | - ->with( |
|
| 108 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks'), |
|
| 109 | - $this->identicalTo(['key' => 'value']) |
|
| 110 | - ); |
|
| 111 | - $bitlink = new Bitlink($mock); |
|
| 112 | - $bitlink->createFullBitlink(['key' => 'value']); |
|
| 113 | - } |
|
| 101 | + public function testCreateFullBitlink() |
|
| 102 | + { |
|
| 103 | + $mock = $this->createMock(ApiInterface::class); |
|
| 104 | + $mock |
|
| 105 | + ->expects($this->once()) |
|
| 106 | + ->method('post') |
|
| 107 | + ->with( |
|
| 108 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks'), |
|
| 109 | + $this->identicalTo(['key' => 'value']) |
|
| 110 | + ); |
|
| 111 | + $bitlink = new Bitlink($mock); |
|
| 112 | + $bitlink->createFullBitlink(['key' => 'value']); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | - public function testUpdateBitlink() |
|
| 116 | - { |
|
| 117 | - $mock = $this->createMock(ApiInterface::class); |
|
| 118 | - $mock |
|
| 119 | - ->expects($this->once()) |
|
| 120 | - ->method('patch') |
|
| 121 | - ->with( |
|
| 122 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test'), |
|
| 123 | - $this->identicalTo(['key' => 'value']) |
|
| 124 | - ); |
|
| 125 | - $bitlink = new Bitlink($mock); |
|
| 126 | - $bitlink->updateBitlink('test', ['key' => 'value']); |
|
| 127 | - } |
|
| 115 | + public function testUpdateBitlink() |
|
| 116 | + { |
|
| 117 | + $mock = $this->createMock(ApiInterface::class); |
|
| 118 | + $mock |
|
| 119 | + ->expects($this->once()) |
|
| 120 | + ->method('patch') |
|
| 121 | + ->with( |
|
| 122 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test'), |
|
| 123 | + $this->identicalTo(['key' => 'value']) |
|
| 124 | + ); |
|
| 125 | + $bitlink = new Bitlink($mock); |
|
| 126 | + $bitlink->updateBitlink('test', ['key' => 'value']); |
|
| 127 | + } |
|
| 128 | 128 | |
| 129 | - public function testGetBitlink() |
|
| 130 | - { |
|
| 131 | - $mock = $this->createMock(ApiInterface::class); |
|
| 132 | - $mock |
|
| 133 | - ->expects($this->once()) |
|
| 134 | - ->method('get') |
|
| 135 | - ->with($this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test')); |
|
| 136 | - $bitlink = new Bitlink($mock); |
|
| 137 | - $bitlink->getBitlink('test'); |
|
| 138 | - } |
|
| 129 | + public function testGetBitlink() |
|
| 130 | + { |
|
| 131 | + $mock = $this->createMock(ApiInterface::class); |
|
| 132 | + $mock |
|
| 133 | + ->expects($this->once()) |
|
| 134 | + ->method('get') |
|
| 135 | + ->with($this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test')); |
|
| 136 | + $bitlink = new Bitlink($mock); |
|
| 137 | + $bitlink->getBitlink('test'); |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - public function testGetClicksSummaryForBitlink() |
|
| 141 | - { |
|
| 142 | - $mock = $this->createMock(ApiInterface::class); |
|
| 143 | - $mock |
|
| 144 | - ->expects($this->once()) |
|
| 145 | - ->method('get') |
|
| 146 | - ->with( |
|
| 147 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/clicks/summary'), |
|
| 148 | - $this->identicalTo(['key' => 'value']) |
|
| 149 | - ); |
|
| 150 | - $bitlink = new Bitlink($mock); |
|
| 151 | - $bitlink->getClicksSummaryForBitlink('test', ['key' => 'value']); |
|
| 152 | - } |
|
| 140 | + public function testGetClicksSummaryForBitlink() |
|
| 141 | + { |
|
| 142 | + $mock = $this->createMock(ApiInterface::class); |
|
| 143 | + $mock |
|
| 144 | + ->expects($this->once()) |
|
| 145 | + ->method('get') |
|
| 146 | + ->with( |
|
| 147 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/clicks/summary'), |
|
| 148 | + $this->identicalTo(['key' => 'value']) |
|
| 149 | + ); |
|
| 150 | + $bitlink = new Bitlink($mock); |
|
| 151 | + $bitlink->getClicksSummaryForBitlink('test', ['key' => 'value']); |
|
| 152 | + } |
|
| 153 | 153 | |
| 154 | - public function testCreateBitlink() |
|
| 155 | - { |
|
| 156 | - $mock = $this->createMock(ApiInterface::class); |
|
| 157 | - $mock |
|
| 158 | - ->expects($this->once()) |
|
| 159 | - ->method('post') |
|
| 160 | - ->with( |
|
| 161 | - $this->equalTo('https://api-ssl.bitly.com/v4/shorten'), |
|
| 162 | - $this->identicalTo(['key' => 'value']) |
|
| 163 | - ); |
|
| 164 | - $bitlink = new Bitlink($mock); |
|
| 165 | - $bitlink->createBitlink(['key' => 'value']); |
|
| 166 | - } |
|
| 154 | + public function testCreateBitlink() |
|
| 155 | + { |
|
| 156 | + $mock = $this->createMock(ApiInterface::class); |
|
| 157 | + $mock |
|
| 158 | + ->expects($this->once()) |
|
| 159 | + ->method('post') |
|
| 160 | + ->with( |
|
| 161 | + $this->equalTo('https://api-ssl.bitly.com/v4/shorten'), |
|
| 162 | + $this->identicalTo(['key' => 'value']) |
|
| 163 | + ); |
|
| 164 | + $bitlink = new Bitlink($mock); |
|
| 165 | + $bitlink->createBitlink(['key' => 'value']); |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | - public function testGetMetricsForBitlinkByReferringDomains() |
|
| 169 | - { |
|
| 170 | - $mock = $this->createMock(ApiInterface::class); |
|
| 171 | - $mock |
|
| 172 | - ->expects($this->once()) |
|
| 173 | - ->method('get') |
|
| 174 | - ->with( |
|
| 175 | - $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referring_domains'), |
|
| 176 | - $this->identicalTo(['key' => 'value']) |
|
| 177 | - ); |
|
| 178 | - $bitlink = new Bitlink($mock); |
|
| 179 | - $bitlink->getMetricsForBitlinkByReferringDomains('test', ['key' => 'value']); |
|
| 180 | - } |
|
| 168 | + public function testGetMetricsForBitlinkByReferringDomains() |
|
| 169 | + { |
|
| 170 | + $mock = $this->createMock(ApiInterface::class); |
|
| 171 | + $mock |
|
| 172 | + ->expects($this->once()) |
|
| 173 | + ->method('get') |
|
| 174 | + ->with( |
|
| 175 | + $this->equalTo('https://api-ssl.bitly.com/v4/bitlinks/test/referring_domains'), |
|
| 176 | + $this->identicalTo(['key' => 'value']) |
|
| 177 | + ); |
|
| 178 | + $bitlink = new Bitlink($mock); |
|
| 179 | + $bitlink->getMetricsForBitlinkByReferringDomains('test', ['key' => 'value']); |
|
| 180 | + } |
|
| 181 | 181 | |
| 182 | 182 | } |
@@ -28,165 +28,165 @@ |
||
| 28 | 28 | class GroupTest extends TestCase |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function testGetGroupTags() |
|
| 32 | - { |
|
| 33 | - $mock = $this->createMock(ApiInterface::class); |
|
| 34 | - $mock |
|
| 35 | - ->expects($this->once()) |
|
| 36 | - ->method('get') |
|
| 37 | - ->with( |
|
| 38 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/tags') |
|
| 39 | - ); |
|
| 40 | - $bitlink = new Group($mock); |
|
| 41 | - $bitlink->getGroupTags('test'); |
|
| 42 | - } |
|
| 31 | + public function testGetGroupTags() |
|
| 32 | + { |
|
| 33 | + $mock = $this->createMock(ApiInterface::class); |
|
| 34 | + $mock |
|
| 35 | + ->expects($this->once()) |
|
| 36 | + ->method('get') |
|
| 37 | + ->with( |
|
| 38 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/tags') |
|
| 39 | + ); |
|
| 40 | + $bitlink = new Group($mock); |
|
| 41 | + $bitlink->getGroupTags('test'); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function testGetGroupMetricsByReferringNetworks() |
|
| 45 | - { |
|
| 46 | - $mock = $this->createMock(ApiInterface::class); |
|
| 47 | - $mock |
|
| 48 | - ->expects($this->once()) |
|
| 49 | - ->method('get') |
|
| 50 | - ->with( |
|
| 51 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/referring_networks') |
|
| 52 | - ); |
|
| 53 | - $bitlink = new Group($mock); |
|
| 54 | - $bitlink->getGroupMetricsByReferringNetworks('test'); |
|
| 55 | - } |
|
| 44 | + public function testGetGroupMetricsByReferringNetworks() |
|
| 45 | + { |
|
| 46 | + $mock = $this->createMock(ApiInterface::class); |
|
| 47 | + $mock |
|
| 48 | + ->expects($this->once()) |
|
| 49 | + ->method('get') |
|
| 50 | + ->with( |
|
| 51 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/referring_networks') |
|
| 52 | + ); |
|
| 53 | + $bitlink = new Group($mock); |
|
| 54 | + $bitlink->getGroupMetricsByReferringNetworks('test'); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - public function testGetGroupShortenCounts() |
|
| 58 | - { |
|
| 59 | - $mock = $this->createMock(ApiInterface::class); |
|
| 60 | - $mock |
|
| 61 | - ->expects($this->once()) |
|
| 62 | - ->method('get') |
|
| 63 | - ->with( |
|
| 64 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/shorten_counts') |
|
| 65 | - ); |
|
| 66 | - $bitlink = new Group($mock); |
|
| 67 | - $bitlink->getGroupShortenCounts('test'); |
|
| 68 | - } |
|
| 57 | + public function testGetGroupShortenCounts() |
|
| 58 | + { |
|
| 59 | + $mock = $this->createMock(ApiInterface::class); |
|
| 60 | + $mock |
|
| 61 | + ->expects($this->once()) |
|
| 62 | + ->method('get') |
|
| 63 | + ->with( |
|
| 64 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/shorten_counts') |
|
| 65 | + ); |
|
| 66 | + $bitlink = new Group($mock); |
|
| 67 | + $bitlink->getGroupShortenCounts('test'); |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - public function testGetGroups() |
|
| 71 | - { |
|
| 72 | - $mock = $this->createMock(ApiInterface::class); |
|
| 73 | - $mock |
|
| 74 | - ->expects($this->once()) |
|
| 75 | - ->method('get') |
|
| 76 | - ->with( |
|
| 77 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups'), |
|
| 78 | - $this->identicalTo(['key' => 'value']) |
|
| 79 | - ); |
|
| 80 | - $bitlink = new Group($mock); |
|
| 81 | - $bitlink->getGroups(['key' => 'value']); |
|
| 82 | - } |
|
| 70 | + public function testGetGroups() |
|
| 71 | + { |
|
| 72 | + $mock = $this->createMock(ApiInterface::class); |
|
| 73 | + $mock |
|
| 74 | + ->expects($this->once()) |
|
| 75 | + ->method('get') |
|
| 76 | + ->with( |
|
| 77 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups'), |
|
| 78 | + $this->identicalTo(['key' => 'value']) |
|
| 79 | + ); |
|
| 80 | + $bitlink = new Group($mock); |
|
| 81 | + $bitlink->getGroups(['key' => 'value']); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - public function testGetGroupPreferences() |
|
| 85 | - { |
|
| 86 | - $mock = $this->createMock(ApiInterface::class); |
|
| 87 | - $mock |
|
| 88 | - ->expects($this->once()) |
|
| 89 | - ->method('get') |
|
| 90 | - ->with( |
|
| 91 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/preferences') |
|
| 92 | - ); |
|
| 93 | - $bitlink = new Group($mock); |
|
| 94 | - $bitlink->getGroupPreferences('test'); |
|
| 95 | - } |
|
| 84 | + public function testGetGroupPreferences() |
|
| 85 | + { |
|
| 86 | + $mock = $this->createMock(ApiInterface::class); |
|
| 87 | + $mock |
|
| 88 | + ->expects($this->once()) |
|
| 89 | + ->method('get') |
|
| 90 | + ->with( |
|
| 91 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/preferences') |
|
| 92 | + ); |
|
| 93 | + $bitlink = new Group($mock); |
|
| 94 | + $bitlink->getGroupPreferences('test'); |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - public function testUpdateGroupPreferences() |
|
| 98 | - { |
|
| 99 | - $mock = $this->createMock(ApiInterface::class); |
|
| 100 | - $mock |
|
| 101 | - ->expects($this->once()) |
|
| 102 | - ->method('patch') |
|
| 103 | - ->with( |
|
| 104 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/preferences'), |
|
| 105 | - $this->identicalTo(['key' => 'value']) |
|
| 106 | - ); |
|
| 107 | - $bitlink = new Group($mock); |
|
| 108 | - $bitlink->updateGroupPreferences('test', ['key' => 'value']); |
|
| 109 | - } |
|
| 97 | + public function testUpdateGroupPreferences() |
|
| 98 | + { |
|
| 99 | + $mock = $this->createMock(ApiInterface::class); |
|
| 100 | + $mock |
|
| 101 | + ->expects($this->once()) |
|
| 102 | + ->method('patch') |
|
| 103 | + ->with( |
|
| 104 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/preferences'), |
|
| 105 | + $this->identicalTo(['key' => 'value']) |
|
| 106 | + ); |
|
| 107 | + $bitlink = new Group($mock); |
|
| 108 | + $bitlink->updateGroupPreferences('test', ['key' => 'value']); |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - public function testGetBitlinksByGroup() |
|
| 112 | - { |
|
| 113 | - $mock = $this->createMock(ApiInterface::class); |
|
| 114 | - $mock |
|
| 115 | - ->expects($this->once()) |
|
| 116 | - ->method('get') |
|
| 117 | - ->with( |
|
| 118 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks'), |
|
| 119 | - $this->identicalTo(['key' => 'value']) |
|
| 120 | - ); |
|
| 121 | - $bitlink = new Group($mock); |
|
| 122 | - $bitlink->getBitlinksByGroup('test', ['key' => 'value']); |
|
| 123 | - } |
|
| 111 | + public function testGetBitlinksByGroup() |
|
| 112 | + { |
|
| 113 | + $mock = $this->createMock(ApiInterface::class); |
|
| 114 | + $mock |
|
| 115 | + ->expects($this->once()) |
|
| 116 | + ->method('get') |
|
| 117 | + ->with( |
|
| 118 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks'), |
|
| 119 | + $this->identicalTo(['key' => 'value']) |
|
| 120 | + ); |
|
| 121 | + $bitlink = new Group($mock); |
|
| 122 | + $bitlink->getBitlinksByGroup('test', ['key' => 'value']); |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - public function testGetGroupMetricsByCountries() |
|
| 126 | - { |
|
| 127 | - $mock = $this->createMock(ApiInterface::class); |
|
| 128 | - $mock |
|
| 129 | - ->expects($this->once()) |
|
| 130 | - ->method('get') |
|
| 131 | - ->with( |
|
| 132 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks') |
|
| 133 | - ); |
|
| 134 | - $bitlink = new Group($mock); |
|
| 135 | - $bitlink->getBitlinksByGroup('test'); |
|
| 136 | - } |
|
| 125 | + public function testGetGroupMetricsByCountries() |
|
| 126 | + { |
|
| 127 | + $mock = $this->createMock(ApiInterface::class); |
|
| 128 | + $mock |
|
| 129 | + ->expects($this->once()) |
|
| 130 | + ->method('get') |
|
| 131 | + ->with( |
|
| 132 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks') |
|
| 133 | + ); |
|
| 134 | + $bitlink = new Group($mock); |
|
| 135 | + $bitlink->getBitlinksByGroup('test'); |
|
| 136 | + } |
|
| 137 | 137 | |
| 138 | - public function testGetSortedBitlinks() |
|
| 139 | - { |
|
| 140 | - $mock = $this->createMock(ApiInterface::class); |
|
| 141 | - $mock |
|
| 142 | - ->expects($this->once()) |
|
| 143 | - ->method('get') |
|
| 144 | - ->with( |
|
| 145 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks/clicks'), |
|
| 146 | - $this->identicalTo(['key' => 'value']) |
|
| 147 | - ); |
|
| 148 | - $bitlink = new Group($mock); |
|
| 149 | - $bitlink->getSortedBitlinks('test', ['key' => 'value']); |
|
| 150 | - } |
|
| 138 | + public function testGetSortedBitlinks() |
|
| 139 | + { |
|
| 140 | + $mock = $this->createMock(ApiInterface::class); |
|
| 141 | + $mock |
|
| 142 | + ->expects($this->once()) |
|
| 143 | + ->method('get') |
|
| 144 | + ->with( |
|
| 145 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test/bitlinks/clicks'), |
|
| 146 | + $this->identicalTo(['key' => 'value']) |
|
| 147 | + ); |
|
| 148 | + $bitlink = new Group($mock); |
|
| 149 | + $bitlink->getSortedBitlinks('test', ['key' => 'value']); |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | - public function testUpdateGroup() |
|
| 153 | - { |
|
| 154 | - $mock = $this->createMock(ApiInterface::class); |
|
| 155 | - $mock |
|
| 156 | - ->expects($this->once()) |
|
| 157 | - ->method('patch') |
|
| 158 | - ->with( |
|
| 159 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test'), |
|
| 160 | - $this->identicalTo(['key' => 'value']) |
|
| 161 | - ); |
|
| 162 | - $bitlink = new Group($mock); |
|
| 163 | - $bitlink->updateGroup('test', ['key' => 'value']); |
|
| 164 | - } |
|
| 152 | + public function testUpdateGroup() |
|
| 153 | + { |
|
| 154 | + $mock = $this->createMock(ApiInterface::class); |
|
| 155 | + $mock |
|
| 156 | + ->expects($this->once()) |
|
| 157 | + ->method('patch') |
|
| 158 | + ->with( |
|
| 159 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test'), |
|
| 160 | + $this->identicalTo(['key' => 'value']) |
|
| 161 | + ); |
|
| 162 | + $bitlink = new Group($mock); |
|
| 163 | + $bitlink->updateGroup('test', ['key' => 'value']); |
|
| 164 | + } |
|
| 165 | 165 | |
| 166 | - public function testGetGroup() |
|
| 167 | - { |
|
| 168 | - $mock = $this->createMock(ApiInterface::class); |
|
| 169 | - $mock |
|
| 170 | - ->expects($this->once()) |
|
| 171 | - ->method('get') |
|
| 172 | - ->with( |
|
| 173 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test') |
|
| 174 | - ); |
|
| 175 | - $bitlink = new Group($mock); |
|
| 176 | - $bitlink->getGroup('test'); |
|
| 177 | - } |
|
| 166 | + public function testGetGroup() |
|
| 167 | + { |
|
| 168 | + $mock = $this->createMock(ApiInterface::class); |
|
| 169 | + $mock |
|
| 170 | + ->expects($this->once()) |
|
| 171 | + ->method('get') |
|
| 172 | + ->with( |
|
| 173 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test') |
|
| 174 | + ); |
|
| 175 | + $bitlink = new Group($mock); |
|
| 176 | + $bitlink->getGroup('test'); |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | - public function testDeleteGroup() |
|
| 180 | - { |
|
| 181 | - $mock = $this->createMock(ApiInterface::class); |
|
| 182 | - $mock |
|
| 183 | - ->expects($this->once()) |
|
| 184 | - ->method('delete') |
|
| 185 | - ->with( |
|
| 186 | - $this->equalTo('https://api-ssl.bitly.com/v4/groups/test') |
|
| 187 | - ); |
|
| 188 | - $bitlink = new Group($mock); |
|
| 189 | - $bitlink->deleteGroup('test'); |
|
| 190 | - } |
|
| 179 | + public function testDeleteGroup() |
|
| 180 | + { |
|
| 181 | + $mock = $this->createMock(ApiInterface::class); |
|
| 182 | + $mock |
|
| 183 | + ->expects($this->once()) |
|
| 184 | + ->method('delete') |
|
| 185 | + ->with( |
|
| 186 | + $this->equalTo('https://api-ssl.bitly.com/v4/groups/test') |
|
| 187 | + ); |
|
| 188 | + $bitlink = new Group($mock); |
|
| 189 | + $bitlink->deleteGroup('test'); |
|
| 190 | + } |
|
| 191 | 191 | |
| 192 | 192 | } |
@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | class Cache { |
| 28 | 28 | |
| 29 | - private $config; |
|
| 29 | + private $config; |
|
| 30 | 30 | |
| 31 | - public function __construct (array $config) |
|
| 32 | - { |
|
| 33 | - $this->config = $config; |
|
| 34 | - } |
|
| 31 | + public function __construct (array $config) |
|
| 32 | + { |
|
| 33 | + $this->config = $config; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /* |
|
| 36 | + /* |
|
| 37 | 37 | This class uses Doctrine Cache. You can look at its doc to add more cache type. |
| 38 | 38 | Whatever option you need to setup the cache type, must be passed as array to constructor. |
| 39 | 39 | https://www.doctrine-project.org/projects/doctrine-cache/en/1.8/index.html |
| 40 | 40 | */ |
| 41 | - public function getCache () |
|
| 42 | - { |
|
| 43 | - switch ($this->config['type']) { |
|
| 41 | + public function getCache () |
|
| 42 | + { |
|
| 43 | + switch ($this->config['type']) { |
|
| 44 | 44 | case 'apc': |
| 45 | 45 | $cache = new \Doctrine\Common\Cache\ApcCache(); |
| 46 | 46 | break; |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | break; |
| 50 | 50 | case 'sqlite3': |
| 51 | 51 | $db = new \SQLite3($this->config['sqlite3_db']); |
| 52 | - $cache = new \SQLite3Cache($db, $this->config['sqlite3_table']); |
|
| 52 | + $cache = new \SQLite3Cache($db, $this->config['sqlite3_table']); |
|
| 53 | 53 | break; |
| 54 | 54 | case 'xcache': |
| 55 | 55 | $cache = new \Doctrine\Common\Cache\XcacheCache(); |
| 56 | - break; |
|
| 57 | - default: |
|
| 56 | + break; |
|
| 57 | + default: |
|
| 58 | 58 | throw new CacheException('Invalid cache system'); |
| 59 | - break; |
|
| 60 | - } |
|
| 61 | - return $cache; |
|
| 62 | - } |
|
| 59 | + break; |
|
| 60 | + } |
|
| 61 | + return $cache; |
|
| 62 | + } |
|
| 63 | 63 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | private $config; |
| 30 | 30 | |
| 31 | - public function __construct (array $config) |
|
| 31 | + public function __construct(array $config) |
|
| 32 | 32 | { |
| 33 | 33 | $this->config = $config; |
| 34 | 34 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | Whatever option you need to setup the cache type, must be passed as array to constructor. |
| 39 | 39 | https://www.doctrine-project.org/projects/doctrine-cache/en/1.8/index.html |
| 40 | 40 | */ |
| 41 | - public function getCache () |
|
| 41 | + public function getCache() |
|
| 42 | 42 | { |
| 43 | 43 | switch ($this->config['type']) { |
| 44 | 44 | case 'apc': |