コード例 #1
0
 public function testGetWorkspace()
 {
     $buddy = new Buddy(['accessToken' => getenv('TOKEN_ALL')]);
     $arr = $buddy->getApiWorkspaces()->getWorkspaces()->getWorkspaces();
     $this->assertGreaterThan(0, count($arr));
     $resp = $buddy->getApiWorkspaces()->getWorkspace($arr[0]->getDomain());
     $this->assertInstanceOf('Buddy\\Objects\\Workspace', $resp);
     $this->assertNotEmpty($resp->getCreateDate());
     $this->assertNotEmpty($resp->getHtmlUrl());
     $this->assertNotEmpty($resp->getUrl());
     $this->assertNotEmpty($resp->getDomain());
     $this->assertNotEmpty($resp->getId());
     $this->assertNotEmpty($resp->getName());
     $this->assertNotEmpty($resp->getOwnerId());
     $this->assertInternalType('bool', $resp->getFrozen());
     $this->assertInternalType('array', $resp->getJson());
 }
コード例 #2
0
 public function getWorkspace()
 {
     try {
         $buddy = new Buddy(['accessToken' => 'yourAccessToken']);
         $resp = $buddy->getApiWorkspaces()->getWorkspace('domain');
         var_dump($resp);
         exit;
     } catch (BuddyResponseException $e) {
         echo $e->getMessage();
         exit;
     } catch (BuddySDKException $e) {
         echo $e->getMessage();
         exit;
     }
 }