addSshOption() public method

public addSshOption ( string $option ) : void
$option string
return void
Example #1
0
 /**
  * @covers DataSift\Storyplayer\CommandLib\SshClient::getSshOptionsForUse
  */
 public function testCanGetSshOptionsAsString()
 {
     // ----------------------------------------------------------------
     // 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 are the default options?
     $expectedOptions = implode(' ', $obj->getDefaultSshOptions());
     // the options to set
     // it doesn't matter if they are valid - we simply expect them
     // to be parrotted back to us later on
     $inputOptions = ["-O", "--fake-option"];
     // ----------------------------------------------------------------
     // perform the change
     foreach ($inputOptions as $option) {
         $obj->addSshOption($option);
         $expectedOptions .= ' ' . $option;
     }
     $actualOptions = $obj->getSshOptionsForUse();
     // ----------------------------------------------------------------
     // test the results
     $this->assertTrue(is_string($actualOptions));
     $this->assertEquals($expectedOptions, $actualOptions);
 }