Ejemplo n.º 1
0
 /**
  * Test MigrationsMigrate method.
  */
 public function testMigrationsMigrate()
 {
     $this->migrationsDirectory = __DIR__ . '/../../../Fixtures/Event';
     $this->given($service = $this->createService())->and($command = new MigrationsMigrateCommand())->and($command->setIo($this->getIO()))->when($service->migrationsMigrate($command))->then()->string($this->output->fetch())->contains('Invalid migration directory');
     $this->given($service = $this->createServiceWithEmptyMigrator())->and($command = new MigrationsMigrateCommand())->and($command->setIo($this->getIO()))->when($service->migrationsMigrate($command))->then()->string($this->output->fetch())->contains('<warn>There is no migration to execute.</warn>');
     $this->migrationsDirectory = __DIR__ . '/../../../Fixtures/Migrations';
     $this->given($service = $this->createServiceWithMigrations())->and($command = new MigrationsMigrateCommand())->and($command->setIo($this->getIO()))->when($service->migrationsMigrate($command))->then()->string($this->output->fetch())->contains('Starting migration to version')->contains('The migration has been <c1>successfully executed</c1>');
 }