protected function setUp()
 {
     parent::setUp();
     DbClient::connect('backup');
     $this->connection = DbClient::getConnection();
     $this->statement = DbClient::prepare($this->sql);
     Config::set('hyperframework.db.operation_profiler.enable', true);
     Config::set('hyperframework.db.operation_profiler.enable_logger', false);
     $this->profiler = new DbOperationProfiler();
 }
 public function testNestedTransactionUsingDifferentConnections()
 {
     DbTransaction::run(function () {
         DbClient::connect('backup');
         DbTransaction::run(function () {
             $this->assertTrue(DbClient::inTransaction());
         });
         $this->assertFalse(DbClient::inTransaction());
         DbClient::connect();
         $this->assertTrue(DbClient::inTransaction());
     });
     $this->assertFalse(DbClient::inTransaction());
 }
 public function testConnect()
 {
     $this->mockEngineMethod('connect')->with($this->equalTo('master'));
     DbClient::connect('master');
 }