rcrowe\Hippy\Client::setToken PHP Method

setToken() public method

Set the token used to authenticate with.
public setToken ( string $token ) : void
$token string API token. See https://{domain}.hipchat.com/admin/api.
return void
    public function setToken($token)
    {
        $this->transport->setToken($token);
    }

Usage Example

Example #1
0
 public function testToken()
 {
     $transport = new Transport(null, null, null);
     $hippy = new Hippy($transport);
     $this->assertNull($hippy->getToken());
     $hippy->setToken('12345');
     $this->assertEquals($hippy->getToken(), '12345');
     $transport = new Transport('54321', null, null);
     $hippy = new Hippy($transport);
     $this->assertEquals($hippy->getToken(), '54321');
 }