public function maybeRestoreDatabase(AfterScenarioScope $scope)
    {
        $db = $this->getWordpressParameter('database');
        if (! $db['restore_after_test']) {
            return;
        }

        $file = $this->getWordpress()->getSetting('database_backup_file');
        if (! $file) {
            return;
        }

        $this->importDatabase(['path' => $file]);
    }
public function maybeRestoreDatabase(AfterScenarioScope $scope)
    {
        $db = $this->getWordpressParameter('database');
        if (! $db['restore_after_test']) {
            return;
        }

        $file = $this->getWordpress()->getSetting('database_backup_file');
        if (! $file) {
            return;
        }

        $this->importDatabase(['path' => $file]);
    }
public function maybeRestoreDatabase ( AfterScenarioScope $ scope ) { $ db = $ this -> getWordpressParameter ( 'database' ) ; if ( ! $ db [ 'restore_after_test' ] ) { return ; } $ file = $ this -> getWordpress ( ) -> getSetting ( 'database_backup_file' ) ; if ( ! $ file ) { return ; } $ this -> importDatabase ( [ 'path' => $ file ] ) ; }
If database.restore_after_test is set, and scenario is tagged "db", restore the database from a backup.

The database will be restored from a backup made via maybeBackupDatabase().

@AfterScenario @db

@param AfterScenarioScope $scope
If database . restore_after_test is set and scenario is tagged db restore the database from a backup .