public function testHelp() { $expected = <<<USAGE Task: [36mdb:migrate[0m [[33mVERSION[0m] 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, [1;31mbut it is your own risk[0m. \t[33mVERSION[0m 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. \t[37mExample A:[0m The database is fresh and empty, assuming there \tare 5 actual migrations, but only the first two should be run. \t\t[35mphigrate db:migrate VERSION=20101006114707[0m \t[37mExample B:[0m The current version of the DB is 20101006114707 \tand we want to go down to 20100921114643 \t\t[35mphigrate db:migrate VERSION=20100921114643[0m \t[37mExample C:[0m You can also use relative number of revisions \t(positive migrate up, negative migrate down). \t\t[35mphigrate db:migrate VERSION=-2[0m USAGE; $actual = $this->object->help(); $this->assertEquals($expected, $actual); }
protected function __construct() { $this->_options['up'] = TRUE; $this->_options['down'] = FALSE; parent::__construct(); }