diff --git a/src/WPCliDb.php b/src/WPCliDb.php index b6eca56..846fd25 100755 --- a/src/WPCliDb.php +++ b/src/WPCliDb.php @@ -68,6 +68,20 @@ public function start_with_dump2() echo "Dump2 not set, default database dump loaded instead."; } } + + public function import_dump($filename) + { + $this->runShellCommand("wp db reset --yes"); + + $file = codecept_data_dir() . $filename; + + if (file_exists($file)) { + $this->runShellCommand("wp db import " . $file); + $this->db_cleanup(); + } else { + $this->fail("Your file does not exist"); + } + } private function db_cleanup() {