<?php use Backup\Databases\MySQLCommands; use Backup\RelationalRepositoryBackup as Repo; use BackupManager\ShellProcessing\ShellProcessor; use Symfony\Component\Process\Process; include __DIR__ . "/../vendor/autoload.php"; //$repo = new Repo(new MySQLCommands([ // "host" => "localhost", // "port" => "3306", // "user" => "root", // "pass" => "root", // "database" => "BackupDatabase" //])); // //$shell = new ShellProcessor(new Process('')); //$shell->process($repo->put("backup.sql")->onlySchema()); //$shell->process($repo->put("backup.sql")->withData()->take()); //$shell->process($repo->put("backup.sql")->withNoData()->take()); //$shell->process($repo->put("backup.sql")->withData()->tables(['posts'])->take()); //$shell->process($repo->put("backup.sql")->withNoData()->tables(['posts'])->take()); //$shell->process($repo->put("backup.sql")->withData()->tables(['posts', 'users'])->take()); //$shell->process($repo->put("backup.sql")->withNoData()->tables(['posts', 'users'])->take()); //$shell->process($repo->put("backup.sql")->withData()->excludeTables(['posts'])->take()); //$shell->process($repo->put("backup.sql")->withNoData()->excludeTables(['posts'])->take()); //$shell->process($repo->put("backup.sql")->withNoData()->excludeTables(['posts', 'users'])->take()); //$shell->process($repo->put("backup.sql")->withData()->excludeTables(['posts', 'users'])->take()); $repo = new Repo(new MySQLCommands(["host" => "localhost", "port" => "3306", "user" => "root", "pass" => "root", "database" => "BackupDatabase"])); $shell = new ShellProcessor(new Process('')); $shell->process($repo->restore("backup.sql"));
public function testTakeShouldReturnSqlString() { $this->mockRelationalRepo->shouldReceive("backupCommand")->once()->andReturn("some shell command"); $this->repository->put("../storage/backup.sql")->take(); }