Пример #1
0
    public function testHelp()
    {
        $expected = <<<USAGE
Task: db:migrate [VERSION]

The primary purpose of the framework is to run migrations, and the
execution of migrations is all handled by just a regular ol' task.

To force the execution of migrations on existing database, you can use
the flag --force, but it is your own risk.

\tVERSION can be specified to go up (or down) to a specific
\tversion, based on the current version. If not specified,
\tall migrations greater than the current database version
\twill be executed.

\tExample A: The database is fresh and empty, assuming there
\tare 5 actual migrations, but only the first two should be run.

\t\tphigrate db:migrate VERSION=20101006114707

\tExample B: The current version of the DB is 20101006114707
\tand we want to go down to 20100921114643

\t\tphigrate db:migrate VERSION=20100921114643

\tExample C: You can also use relative number of revisions
\t(positive migrate up, negative migrate down).

\t\tphigrate db:migrate VERSION=-2

USAGE;
        $actual = $this->object->help();
        $this->assertEquals($expected, $actual);
    }
Пример #2
0
 protected function __construct()
 {
     $this->_options['up'] = TRUE;
     $this->_options['down'] = FALSE;
     parent::__construct();
 }