/** * @throws \Napp\AeroGearPush\Exception\AeroGearAuthErrorException * @throws \Napp\AeroGearPush\Exception\AeroGearBadRequestException * @throws \Napp\AeroGearPush\Exception\AeroGearNotFoundException * @throws \Napp\AeroGearPush\Exception\AeroGearPushException */ public function testMetricsDashboardActive() { $client = new DummyClient(); $response = $client->call('GET', 'https://host.com/rest', 'metrics/dashboard/active', [], [], []); $response = json_decode($response); $this->assertCount(0, $response); }
/** * @throws \Napp\AeroGearPush\Exception\AeroGearAuthErrorException * @throws \Napp\AeroGearPush\Exception\AeroGearBadRequestException * @throws \Napp\AeroGearPush\Exception\AeroGearNotFoundException * @throws \Napp\AeroGearPush\Exception\AeroGearPushException */ public function testMetricsDashboard() { $client = new DummyClient(); $response = $client->call('GET', 'https://host.com/rest', 'metrics/dashboard', [], [], []); $response = json_decode($response); $this->assertEquals(4, $response->applications); $this->assertEquals(3, $response->devices); $this->assertEquals(2, $response->messages); }
public function testCreateSimplepushVariant() { $client = new DummyClient(); $response = $client->call('POST', 'https://host.com/rest', 'applications/6d917118/simplePush', [], [], []); $response = json_decode($response); $this->assertEquals('22debd80-04ab-4213-ac6f-18d6c0c106fe', $response->id); $this->assertEquals('13f663bc-6321-4fc0-b8e1-77429d6c180c', $response->variantID); $this->assertEquals('simplePush', $response->type); }
/** * @throws \Napp\AeroGearPush\Exception\AeroGearAuthErrorException * @throws \Napp\AeroGearPush\Exception\AeroGearBadRequestException * @throws \Napp\AeroGearPush\Exception\AeroGearNotFoundException * @throws \Napp\AeroGearPush\Exception\AeroGearPushException */ public function testCreateApplication() { $client = new DummyClient(); $response = $client->call('POST', 'https://host.com/rest', 'applications', [], [], []); $response = json_decode($response); $this->assertEquals('3aad1e92-3255-461b-8129-854025a5e7ab', $response->id); $this->assertEquals('dc5df3f3-2609-4547-9cc5-a844fc3b09e3', $response->pushApplicationID); $this->assertEmpty($response->variants); }
/** * @throws \Napp\AeroGearPush\Exception\AeroGearAuthErrorException * @throws \Napp\AeroGearPush\Exception\AeroGearBadRequestException * @throws \Napp\AeroGearPush\Exception\AeroGearNotFoundException * @throws \Napp\AeroGearPush\Exception\AeroGearPushException */ public function testCreateAndroidVariant() { $client = new DummyClient(); $response = $client->call('POST', 'https://host.com/rest', 'applications/6d917118/android', [], [], []); $response = json_decode($response); $this->assertEquals('a69d2e3f-1447-4bfc-b355-42439e2c2ab9', $response->id); $this->assertEquals('a6d35fa9-8ed4-459d-a1f9-c8d0a3c9c34f', $response->variantID); $this->assertEquals('{GOOGLE_KEY}', $response->googleKey); $this->assertEquals('android', $response->type); }
/** * @throws \Napp\AeroGearPush\Exception\AeroGearAuthErrorException * @throws \Napp\AeroGearPush\Exception\AeroGearBadRequestException * @throws \Napp\AeroGearPush\Exception\AeroGearNotFoundException * @throws \Napp\AeroGearPush\Exception\AeroGearPushException */ public function testHealth() { $client = new DummyClient(); $response = $client->call('GET', 'https://host.com/rest', 'sys/info/health', [], [], []); $response = json_decode($response); $this->assertEquals('ok', $response->status); $this->assertCount(5, $response->details); $this->assertEquals('Everything is ok', $response->summary); $this->assertEquals('ok', $response->details[3]->test_status); $this->assertEquals('online', $response->details[4]->result); }