Pantheon\Terminus\Models\User::dashboardUrl PHP Method

dashboardUrl() public method

Provides Pantheon Dashboard URL for this user
public dashboardUrl ( ) : string
return string
    public function dashboardUrl()
    {
        $url = sprintf('%s://%s/users/%s#sites', $this->getConfig()->get('dashboard_protocol'), $this->getConfig()->get('dashboard_host'), $this->id);
        return $url;
    }

Usage Example

Example #1
0
 public function testDashboardUrl()
 {
     $config = $this->getMockBuilder(Config::class)->disableOriginalConstructor()->getMock();
     $config->expects($this->exactly(2))->method('get')->withConsecutive($this->equalTo('dashboard_protocol'), $this->equalTo('dashboard_host'))->willReturnOnConsecutiveCalls('https', 'dashboard.pantheon.io');
     $this->user->setConfig($config);
     $this->assertEquals('https://dashboard.pantheon.io/users/123#sites', $this->user->dashboardUrl());
 }