public function testDisconnectAllRollsBackTransaction()
 {
     $person = new Person();
     $person->name = 'Nicko McBrain';
     $person->income = 12345;
     $person->save();
     $id = $person->id;
     DB::begin();
     $p = Person::get($id);
     $p->income = 54321;
     $p->save();
     DB::disconnectAll();
     $this->assertEquals(12345, Person::get($id)->income);
 }
Exemple #2
0
 /**
  * Configures database definitions.
  *
  * @param string|array $config Either a path to the JSON encoded
  *      configuration file, or the configuration as an array.
  */
 public static function configure($config)
 {
     DB::disconnectAll();
     Config::load($config);
 }