/** * Test library instantiation */ public function testInstance() { $sink = Sink::instance(); $sink->table('one_table'); $library = Sink::instance(); $tables = $library->table('second_table'); $this->assertEquals(2, count($tables)); $this->assertEquals('one_table', $tables[0]); $this->assertEquals('second_table', $tables[1]); }
/** * Apply database patches */ public function action_patches() { Sink::instance()->patch($available, $applied); echo '<h1>Patches:</h1>'; echo '<h2>Available patches:</h2>'; echo '<pre>'; foreach ($available as $table => $patches) { foreach ($patches as $num => $descrip) { echo "{$num} [{$table}] - {$descrip}<br />"; } } echo '</pre>'; echo '<h2>Applied patches:</h2>'; echo '<pre>'; foreach ($applied as $table => $patches) { foreach ($patches as $num => $patch) { echo "{$num} [{$table}] - {$patch['descrip']}<br />"; echo ' ' . ($patch['result'] ? 'Patch applied successfully.' : 'Error applying patch.') . '<br />'; } } echo '</pre>'; }
public function before() { Sink::instance()->tables(array('ut_init', 'ut_pop')); }
/** * Set tables */ public function before() { Sink::instance()->table('users'); }