Пример #1
0
 private function assertDestFileExists($filePath, $contents = null)
 {
     $command = new Ssh\Command($this->sourceSsh);
     $command->exec("cat " . escapeshellarg($filePath));
     $this->assertTrue($command->success());
     if ($contents !== null) {
         $this->assertEquals($command->getOutput(), $contents);
     }
 }
 public function testBasicRemoteToRemoteSync()
 {
     $options = $this->getRemoteToRemoteOptions();
     $dbSync = new DatabaseSync($options);
     $success = $dbSync->sync([$this, "statusCallback"]);
     $this->assertTrue($success);
     $scmd = new Ssh\Command($this->destSsh);
     $remoteQueryCommand = CommandUtil::buildMysqlCommand($options['dest']['db']);
     $remoteQueryCommand .= " -e 'select name, content from wp_deploy_synctest'";
     $scmd->exec($remoteQueryCommand);
     $this->assertTrue($scmd->success());
     $this->assertRegExp("/test_value_one\ttest_content_one/", $scmd->getOutput());
 }
Пример #3
0
 public function testNoOutput()
 {
     $command = new Command($this->session);
     $command->exec("ls a/path/that/hopefully/doesnt/exist/if/it/does/craziness");
     $this->assertEmpty($command->getOutput());
 }