private function applyMigration(Name $name, Direction $direction) { $migration = $this->service->createMigrationInstance($name, $this->output); if ($direction->isUp()) { $this->output->writeln('<info>Testing ' . $name . ' going up.</info>'); $migration->up($this->service->getDatabase()); } elseif ($direction->isDown()) { $this->output->writeln('<info>Testing ' . $name . ' going down.</info>'); $migration->down($this->service->getDatabase()); } }
private function applyMigration(Name $name, Direction $direction) { $fullClassName = 'Mongrate\\Migrations\\' . $name; $migration = new $fullClassName(); if ($direction->isUp()) { $this->output->writeln('<info>Testing ' . $name . ' going up.</info>'); $migration->up($this->service->getDatabase()); } elseif ($direction->isDown()) { $this->output->writeln('<info>Testing ' . $name . ' going down.</info>'); $migration->down($this->service->getDatabase()); } }
public function testIsDown() { $direction = new Direction(DirectionEnum::DOWN); $this->assertTrue($direction->isDown()); }