/** * Ensures that all migrations have been run. */ public function latest() { CLI::write('Migrating to latest version...', 'yellow'); try { $this->runner->latest(); } catch (\Exception $e) { $this->showError($e); } CLI::write('Done'); }
/** * Ensures that the database is cleaned up to a known state * before each test runs. * * @throws ConfigException */ public function setUp() { $this->loadDependencies(); if ($this->refresh === true) { if (!empty($this->basePath)) { $this->migrations->setPath(rtrim($this->basePath, '/') . '/migrations'); } $this->db->table('migrations')->truncate(); $this->migrations->version(0, 'tests'); $this->migrations->latest('tests'); } if (!empty($this->seed)) { if (!empty($this->basePath)) { $this->seeder->setPath(rtrim($this->basePath, '/') . '/seeds'); } $this->seed($this->seed); } }