DataSift\Storyplayer\CommandLib\SshClientTest::testCanGetSshKeyForUse PHP Method

testCanGetSshKeyForUse() public method

    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);
    }