DataSift\Storyplayer\CommandLib\SshClient::getSshKey PHP Method

getSshKey() public method

public getSshKey ( ) : string
return string
    public function getSshKey()
    {
        return $this->sshKey;
    }

Usage Example

Esempio n. 1
0
 /**
  * @covers DataSift\Storyplayer\CommandLib\SshClient::getSshKeyForUse
  */
 public function testCanGetSshKeyForUse()
 {
     // ----------------------------------------------------------------
     // setup your test
     // our $st object
     $i = new Injectables();
     $i->initOutputSupport();
     $i->initDataFormatterSupport();
     $i->initRuntimeConfigSupport($i);
     $st = new StoryTeller($i);
     // our test subject
     $obj = new SshClient($st);
     // what key will we use?
     $expectedKey = 'id_rsa';
     $expectedResult = "-i '" . $expectedKey . "'";
     // make sure that (if there is ever a default ssh key), it isn't
     // the string we're testing with
     $this->assertNotEquals($expectedResult, $obj->getSshKey());
     // ----------------------------------------------------------------
     // perform the change
     $obj->setSshKey($expectedKey);
     $actualResult = $obj->getSshKeyForUse();
     // ----------------------------------------------------------------
     // test the results
     $this->assertTrue(is_string($actualResult));
     $this->assertEquals($expectedResult, $actualResult);
 }