Beispiel #1
0
 /**
  * Other connection
  *
  * @return null
  */
 public function testOtherConnection()
 {
     $file = realpath(dirname(__FILE__) . "/../database/another_test.sqlite3");
     $con = new PDO("sqlite:{$file}");
     AnotherUser::setConnection($con, "test");
     $user = AnotherUser::first();
     $this->assertEquals("Walternate", $user->name);
     $this->assertEquals($con, AnotherUser::resolveConnection());
     $ouser = AnotherUser::find($user->id);
     $this->assertEquals($user, $ouser);
     $this->assertEquals($con, AnotherUser::resolveConnection());
 }
Beispiel #2
0
<?php

class AnotherUser extends TORM\Model
{
}
AnotherUser::setTableName("users");