src/Codeception/Module/WPDb.php
public function importSqlDumpFile($dumpFile = null)
    {
        if ($dumpFile !== null) {
            if (!file_exists($dumpFile) || !is_readable($dumpFile)) {
                throw new \InvalidArgumentException("Dump file [{$dumpFile}] does not exist or is not readable.");
            }

            $this->driver->load($dumpFile);

            return;
        }

        if ($this->config['populate']) {
            $this->_cleanup();
            $this->_loadDump();
            $this->populated = true;
        }
    }
public function importSqlDumpFile($dumpFile = null)
    {
        if ($dumpFile !== null) {
            if (!file_exists($dumpFile) || !is_readable($dumpFile)) {
                throw new \InvalidArgumentException("Dump file [{$dumpFile}] does not exist or is not readable.");
            }

            $this->driver->load($dumpFile);

            return;
        }

        if ($this->config['populate']) {
            $this->_cleanup();
            $this->_loadDump();
            $this->populated = true;
        }
    }
public function importSqlDumpFile ( $ dumpFile = null ) { if ( $ dumpFile !== null ) { if ( ! file_exists ( $ dumpFile ) || ! is_readable ( $ dumpFile ) ) { throw new \ InvalidArgumentException ( "Dump file [{$dumpFile}] does not exist or is not readable." ) ; } $ this -> driver -> load ( $ dumpFile ) ; return ; } if ( $ this -> config [ 'populate' ] ) { $ this -> _cleanup ( ) ; $ this -> _loadDump ( ) ; $ this -> populated = true ; } }
Import the SQL dump file if populate is enabled.

@example
```php
// Import a dump file passing the absolute path.
$I->importSqlDumpFile(codecept_data_dir('dumps/start.sql'));
```

Specifying a dump file that file will be imported.

@param null|string $dumpFile The dump file that should be imported in place of the default one.

@throws \InvalidArgumentException If the specified file does not exist.
Import the SQL dump file if populate is enabled .