vendor/doctrine-migrations/tests/Doctrine/DBAL/Migrations/Tests/MigrationTest.php
author cavaliet
Mon, 07 Jul 2014 17:23:47 +0200
changeset 122 d672f7dd74dc
parent 39 03b14b0fe101
permissions -rw-r--r--
Added tag V00.17 for changeset ada5f3d8b5b4

<?php

namespace Doctrine\DBAL\Migrations\Tests;

use Doctrine\DBAL\Migrations\Configuration\Configuration;
use Doctrine\DBAL\Migrations\Migration;

class MigrationTest extends MigrationTestCase
{
    private $config;

    public function setUp()
    {
        $this->config = new Configuration($this->getSqliteConnection());
        $this->config->setMigrationsDirectory(\sys_get_temp_dir());
        $this->config->setMigrationsNamespace('DoctrineMigrations\\');
    }

    public function testMigrateToUnknownVersionThrowsException()
    {
        $migration = new Migration($this->config);

        $this->setExpectedException('Doctrine\DBAL\Migrations\MigrationException', 'Could not find migration version 1234');
        $migration->migrate('1234');
    }

    public function testMigrateToCurrentVersionReturnsEmpty()
    {
        $migration = new Migration($this->config);

        $sql = $migration->migrate('0');
        $this->assertEquals(array(), $sql);
    }
}