/** * Test patching on a previous patch */ public function testSecondPatch() { $migration = new Migration(); $migration->table('ut_pop'); $migration->initialize(); DB::insert('db_deltas', array('id', 'file'))->values(array(1, '01-ut_pop-add_column'))->execute(); $result = $migration->patch(); $this->assertEquals(1, count($result[1])); $this->assertRegExp('/ut_pop/', $result[1][2]['descrip']); $this->assertTrue($result[1][2]['result']); $database = Database::instance(); $columns = $database->list_columns('ut_pop'); $this->assertArrayNotHasKey('editor', $columns); $this->assertArrayHasKey('modified', $columns); }