コード例 #1
0
 public function testProjectAccess()
 {
     $writer = $this->client->getWriter(FUNCTIONAL_WRITER_ID);
     $this->assertArrayHasKey('gd', $writer);
     $this->assertArrayHasKey('pid', $writer['gd']);
     try {
         $this->client->disableProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
     } catch (ClientErrorResponseException $e) {
     }
     try {
         $this->client->getProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
         $this->fail();
     } catch (ClientErrorResponseException $e) {
     }
     $this->client->enableProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
     $result = $this->client->getProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
     $this->assertNotEmpty($result);
     $this->assertStringStartsWith('https://secure.gooddata.com/', $result);
     $this->assertStringEndsNotWith('#/info/ssoFailed', $result);
     $this->client->disableProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
     try {
         $this->client->getProjectAccess(FUNCTIONAL_WRITER_ID, $writer['gd']['pid']);
         $this->fail();
     } catch (ClientErrorResponseException $e) {
     }
 }
コード例 #2
0
 public function getWriter()
 {
     if ($this->writer == null) {
         $this->writer = Writer::factory(array('token' => $this->sapiClient->getTokenString(), 'url' => $this->writerUrl));
     }
     return $this->writer;
 }